Commit e2056677 by Richard Kenner

(do_xifdef): Warn about `#ifdef 0' if not traditional; formerly the

warning was issued if not pedantic.

From-SVN: r10992
parent 58a08882
/* C Compatible Compiler Preprocessor (CCCP) /* 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 Written by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987 Adapted to ANSI C, Richard Stallman, Jan 1987
...@@ -7046,10 +7046,12 @@ do_xifdef (buf, limit, op, keyword) ...@@ -7046,10 +7046,12 @@ do_xifdef (buf, limit, op, keyword)
} else { } else {
HASHNODE *hp; HASHNODE *hp;
if (pedantic && buf[0] >= '0' && buf[0] <= '9') if (! traditional) {
if (isdigit (buf[0]))
pedwarn ("`#%s' argument starts with a digit", keyword->name); pedwarn ("`#%s' argument starts with a digit", keyword->name);
else if (end != limit && !traditional) else if (end != limit)
pedwarn ("garbage at end of `#%s' argument", keyword->name); pedwarn ("garbage at end of `#%s' argument", keyword->name);
}
hp = lookup (buf, end-buf, -1); hp = lookup (buf, end-buf, -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment