From 48776cde064312d9fd9bac8c3d0fd73be6944255 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Tue, 30 Nov 1999 23:26:37 +0000 Subject: 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 --- gcc/c-lex.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/c-lex.c') 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)) -- cgit v1.1