aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-03-19 16:58:28 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-03-19 16:58:28 -0500
commitb2feb130caf3e0d2593affeb7d34fa1f68928f6a (patch)
tree7842784ad68ea2203be7a57d120f788fab9b1689 /gcc
parent21c24d8861a00025be2a91906ef5f70417538422 (diff)
downloadgcc-b2feb130caf3e0d2593affeb7d34fa1f68928f6a.zip
gcc-b2feb130caf3e0d2593affeb7d34fa1f68928f6a.tar.gz
gcc-b2feb130caf3e0d2593affeb7d34fa1f68928f6a.tar.bz2
(c89): New decl.
(main): Set it to 1 if -lang-c89. From-SVN: r13747
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index b8426f2..8be2e98 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -464,6 +464,10 @@ static int warnings_are_errors;
int traditional;
+/* Nonzero for the 1989 C Standard, including corrigenda and amendments. */
+
+int c89;
+
/* Nonzero causes output not to be done,
but directives such as #define that have side effects
are still obeyed. */
@@ -1502,15 +1506,15 @@ main (argc, argv)
case 'l':
if (! strcmp (argv[i], "-lang-c"))
- cplusplus = 0, cplusplus_comments = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, objc = 0;
if (! strcmp (argv[i], "-lang-c89"))
- cplusplus = 0, cplusplus_comments = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, objc = 0;
if (! strcmp (argv[i], "-lang-c++"))
- cplusplus = 1, cplusplus_comments = 1, objc = 0;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, objc = 0;
if (! strcmp (argv[i], "-lang-objc"))
- objc = 1, cplusplus = 0, cplusplus_comments = 1;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, objc = 1;
if (! strcmp (argv[i], "-lang-objc++"))
- objc = 1, cplusplus = 1, cplusplus_comments = 1;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, objc = 1;
if (! strcmp (argv[i], "-lang-asm"))
lang_asm = 1;
if (! strcmp (argv[i], "-lint"))
@@ -3061,16 +3065,17 @@ do { ip = &instack[indepth]; \
}
*obp++ = c;
/* A sign can be part of a preprocessing number
- if it follows an e. */
- if (c == 'e' || c == 'E') {
+ if it follows an `e' or `p'. */
+ if (c == 'e' || c == 'E' || c == 'p' || c == 'P') {
while (ibp[0] == '\\' && ibp[1] == '\n') {
++ip->lineno;
ibp += 2;
}
if (*ibp == '+' || *ibp == '-') {
*obp++ = *ibp++;
- /* But traditional C does not let the token go past the sign. */
- if (traditional)
+ /* But traditional C does not let the token go past the sign,
+ and C89 does not allow `p'. */
+ if (traditional || (c89 && (c == 'p' || c == 'P')))
break;
}
}