aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-11-30 23:26:37 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-11-30 23:26:37 +0000
commit48776cde064312d9fd9bac8c3d0fd73be6944255 (patch)
tree1d2e79beb5a4999f5868fca5ed690dba7a1f2a64 /gcc/c-lex.c
parent481c7efae8707188049cf59ad97f682ba68576ce (diff)
downloadgcc-48776cde064312d9fd9bac8c3d0fd73be6944255.zip
gcc-48776cde064312d9fd9bac8c3d0fd73be6944255.tar.gz
gcc-48776cde064312d9fd9bac8c3d0fd73be6944255.tar.bz2
c-lex.c (yylex): With -Wtraditional...
* c-lex.c (yylex): With -Wtraditional, when the ANSI type of an integer constant does not match the traditional type, limit the warnings to cases where the base of the type is ten. * invoke.texi (-Wtraditional): Document it. From-SVN: r30730
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index ab71f78..d4710a8 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1901,7 +1901,11 @@ yylex ()
type = flag_traditional ? traditional_type : ansi_type;
- if (warn_traditional && traditional_type != ansi_type)
+ /* We assume that constants specified in a non-decimal
+ base are bit patterns, and that the programmer really
+ meant what they wrote. */
+ if (warn_traditional && base == 10
+ && traditional_type != ansi_type)
{
if (TYPE_PRECISION (traditional_type)
!= TYPE_PRECISION (ansi_type))