aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-01-15 14:38:51 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1996-01-15 14:38:51 -0500
commite20566775fb3818d9c3ab6980ad246a791d46039 (patch)
treee2f4d80a0d67ed4e559855d10a27f5493e243580 /gcc/cccp.c
parent58a0888230a9fad41025ab1078f48700aac93b0d (diff)
downloadgcc-e20566775fb3818d9c3ab6980ad246a791d46039.zip
gcc-e20566775fb3818d9c3ab6980ad246a791d46039.tar.gz
gcc-e20566775fb3818d9c3ab6980ad246a791d46039.tar.bz2
(do_xifdef): Warn about `#ifdef 0' if not traditional; formerly the
warning was issued if not pedantic. From-SVN: r10992
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index bf20b2a..df1735c 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1,5 +1,5 @@
/* C Compatible Compiler Preprocessor (CCCP)
- Copyright (C) 1986, 87, 89, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 89, 92-95, 1996 Free Software Foundation, Inc.
Written by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -7046,10 +7046,12 @@ do_xifdef (buf, limit, op, keyword)
} else {
HASHNODE *hp;
- if (pedantic && buf[0] >= '0' && buf[0] <= '9')
- pedwarn ("`#%s' argument starts with a digit", keyword->name);
- else if (end != limit && !traditional)
- pedwarn ("garbage at end of `#%s' argument", keyword->name);
+ if (! traditional) {
+ if (isdigit (buf[0]))
+ pedwarn ("`#%s' argument starts with a digit", keyword->name);
+ else if (end != limit)
+ pedwarn ("garbage at end of `#%s' argument", keyword->name);
+ }
hp = lookup (buf, end-buf, -1);