Commit fbcd3360 by Richard Kenner

(create_definition): Warn about `#define a@'...

(create_definition): Warn about `#define a@', since a diagnostic is
now required (see ISO TC1's addition to subclause 6.8).  Also warn
about `#define is-empty(x) (!x)'.

From-SVN: r7877
parent 73b2ad9e
......@@ -5368,9 +5368,31 @@ create_definition (buf, limit, op)
} else {
/* Simple expansion or empty definition. */
/* Skip spaces and tabs if any. */
while (bp < limit && (*bp == ' ' || *bp == '\t'))
++bp;
if (bp < limit)
{
switch (*bp)
{
case '\t': case ' ':
/* Skip spaces and tabs. */
while (++bp < limit && (*bp == ' ' || *bp == '\t'))
continue;
break;
case '!': case '"': case '#': case '%': case '&': case '\'':
case ')': case '*': case '+': case ',': case '-': case '.':
case '/': case ':': case ';': case '<': case '=': case '>':
case '?': case '[': case '\\': case ']': case '^': case '{':
case '|': case '}': case '~':
warning ("missing white space after `#define %.*s'",
sym_length, symname);
break;
default:
pedwarn ("missing white space after `#define %.*s'",
sym_length, symname);
break;
}
}
/* Now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) "";
......
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