Commit 21c24d88 by Richard Kenner

(parse_number, yylex), cccp.c (rescan), cpplib.c

(parse_number, yylex), cccp.c (rescan), cpplib.c
(cpp_get_token): Unless -lang-c89 is specified, allow C9X-style
hexadecimal floating-point numbers as preprocessor numbers.

From-SVN: r13746
parent b415e100
......@@ -161,6 +161,9 @@ extern int pedantic;
/* Flag for -traditional. */
extern int traditional;
/* Flag for -lang-c89. */
extern int c89;
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
......@@ -531,7 +534,7 @@ parse_number (olen)
yylval.integer.signedp = UNSIGNED;
}
else {
if (c == '.' || c == 'e' || c == 'E')
if (c == '.' || c == 'e' || c == 'E' || c == 'p' || c == 'P')
yyerror ("Floating point numbers not allowed in #if expressions");
else {
char *buf = (char *) alloca (p - lexptr + 40);
......@@ -834,7 +837,9 @@ yylex ()
for (namelen = 1; ; namelen++) {
int d = tokstart[namelen];
if (! ((is_idchar[d] || d == '.')
|| ((d == '-' || d == '+') && (c == 'e' || c == 'E')
|| ((d == '-' || d == '+')
&& (c == 'e' || c == 'E'
|| ((c == 'p' || c == 'P') && ! c89))
&& ! traditional)))
break;
c = d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment