aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-03-19 16:57:58 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-03-19 16:57:58 -0500
commit21c24d8861a00025be2a91906ef5f70417538422 (patch)
tree64dafb5e444a68e38b4bd78d253bb766a26f320f
parentb415e1000b951b555b6b5ed0636201a0dbf3cf4c (diff)
downloadgcc-21c24d8861a00025be2a91906ef5f70417538422.zip
gcc-21c24d8861a00025be2a91906ef5f70417538422.tar.gz
gcc-21c24d8861a00025be2a91906ef5f70417538422.tar.bz2
(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
-rw-r--r--gcc/cexp.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cexp.y b/gcc/cexp.y
index 1888751..2d2d34f 100644
--- a/gcc/cexp.y
+++ b/gcc/cexp.y
@@ -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;