aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 30a49ae..a1ef536 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))