(do_xifdef): Warn about `#ifdef 0' if not traditional; formerly the
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 15 Jan 1996 19:38:51 +0000 (14:38 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 15 Jan 1996 19:38:51 +0000 (14:38 -0500)
warning was issued if not pedantic.

From-SVN: r10992

gcc/cccp.c

index bf20b2ad00aa6cb4925df13e6c3e6f95e32dc6f9..df1735c364380e0b3a77997c89ffb296c8c9c6b0 100644 (file)
@@ -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);