diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-30 23:26:37 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-11-30 23:26:37 +0000 |
commit | cc13a10a1e9ebc15e97cf3ba939dae87f2edc77b (patch) | |
tree | 1d2e79beb5a4999f5868fca5ed690dba7a1f2a64 /gcc/c-lex.c | |
parent | 287e48a086ce4447a6e7fe030cba6d078341f88a (diff) | |
download | gcc-cc13a10a1e9ebc15e97cf3ba939dae87f2edc77b.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index ab71f787228..d4710a81942 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)) |