summaryrefslogtreecommitdiff
path: root/gcc/cexp.y
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-19 21:57:58 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-19 21:57:58 +0000
commite4ed3356c157a3d2290afb258abfe90444013644 (patch)
tree64dafb5e444a68e38b4bd78d253bb766a26f320f /gcc/cexp.y
parent9ca5ce341e8fdc872a548eacf2f7f7c94ccb4a38 (diff)
downloadgcc-e4ed3356c157a3d2290afb258abfe90444013644.tar.gz
(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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cexp.y')
-rw-r--r--gcc/cexp.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cexp.y b/gcc/cexp.y
index 18887511fab..2d2d34f8b28 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;