aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-14 18:45:50 +0000
committerRichard Stallman <rms@gnu.org>1992-09-14 18:45:50 +0000
commitc832a30eb3e84359ee7c62a64e6030bcaf9d2ba4 (patch)
treef53fc945e8625f92eed9df99e5d2c3778267664d
parent57caa638af543fe30bd9456b448b8a03b6b4b970 (diff)
downloadgcc-c832a30eb3e84359ee7c62a64e6030bcaf9d2ba4.zip
gcc-c832a30eb3e84359ee7c62a64e6030bcaf9d2ba4.tar.gz
gcc-c832a30eb3e84359ee7c62a64e6030bcaf9d2ba4.tar.bz2
(yylex): Warn about integers so large that they are unsigned.
From-SVN: r2120
-rw-r--r--gcc/c-lex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 629e93b..0546150 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1585,6 +1585,9 @@ yylex ()
&& !warn)
pedwarn ("integer constant out of range");
+ if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type))
+ warning ("integer constant is so large that it is unsigned");
+
if (flag_traditional && !int_fits_type_p (yylval.ttype, type))
/* The traditional constant 0x80000000 is signed
but doesn't fit in the range of int.