diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-07 00:31:01 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-07 00:31:01 +0000 |
commit | ad87de1ece2f52d260b582709751ab9f315ab349 (patch) | |
tree | ec80f8d1e46852ac1ba45aecdcda7201c302ac6f /gcc/c-lex.c | |
parent | 8098b1a5d828997acb2555106b3edccc0b43b661 (diff) | |
download | ppe42-gcc-ad87de1ece2f52d260b582709751ab9f315ab349.tar.gz ppe42-gcc-ad87de1ece2f52d260b582709751ab9f315ab349.zip |
Merge from gcc-2.8
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16987 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 30a49aea43e..a1ef5362ca9 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -135,6 +135,9 @@ static int end_of_file; static int nextchar = -1; #endif +static int skip_which_space PROTO((int)); +static char *extend_token_buffer PROTO((char *)); +static int readescape PROTO((int *)); int check_newline (); /* Do not insert generated code into the source, instead, include it. @@ -330,7 +333,6 @@ yyprint (file, yychar, yylval) break; } } - /* Iff C is a carriage return, warn about it - if appropriate - and return nonzero. */ @@ -468,7 +470,6 @@ extend_token_buffer (p) return token_buffer + offset; } - #if !USE_CPPLIB #define GET_DIRECTIVE_LINE() get_directive_line (finput) @@ -1711,20 +1712,15 @@ yylex () c = GETC(); } - /* If the constant is not long long and it won't fit in an - unsigned long, or if the constant is long long and won't fit - in an unsigned long long, then warn that the constant is out - of range. */ + /* If the constant won't fit in an unsigned long long, + then warn that the constant is out of range. */ /* ??? This assumes that long long and long integer types are a multiple of 8 bits. This better than the original code though which assumed that long was exactly 32 bits and long long was exactly 64 bits. */ - if (spec_long_long) - bytes = TYPE_PRECISION (long_long_integer_type_node) / 8; - else - bytes = TYPE_PRECISION (long_integer_type_node) / 8; + bytes = TYPE_PRECISION (long_long_integer_type_node) / 8; warn = overflow; for (i = bytes; i < TOTAL_PARTS; i++) @@ -1791,7 +1787,9 @@ yylex () else if (! spec_unsigned && !spec_long_long && int_fits_type_p (yylval.ttype, long_integer_type_node)) ansi_type = long_integer_type_node; - else if (! spec_long_long) + else if (! spec_long_long + && int_fits_type_p (yylval.ttype, + long_unsigned_type_node)) ansi_type = long_unsigned_type_node; else if (! spec_unsigned && int_fits_type_p (yylval.ttype, @@ -1815,8 +1813,9 @@ yylex () warning ("width of integer constant may change on other systems with -traditional"); } - if (!flag_traditional && !int_fits_type_p (yylval.ttype, type) - && !warn) + if (pedantic && !flag_traditional && !spec_long_long && !warn + && (TYPE_PRECISION (long_integer_type_node) + < TYPE_PRECISION (type))) pedwarn ("integer constant out of range"); if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type)) |