(yylex): Warn about integers so large that they are unsigned.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Sep 1992 18:45:50 +0000 (18:45 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Sep 1992 18:45:50 +0000 (18:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2120 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-lex.c

index 629e93b..0546150 100644 (file)
@@ -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.