From c832a30eb3e84359ee7c62a64e6030bcaf9d2ba4 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 14 Sep 1992 18:45:50 +0000 Subject: (yylex): Warn about integers so large that they are unsigned. From-SVN: r2120 --- gcc/c-lex.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc') 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. -- cgit v1.1