Commit 3be5fb23 by Richard Kenner

(rescan): Don't recognize preprocessing directives within macro args.

Warn if one is found.

From-SVN: r9257
parent bb1835d2
...@@ -2586,8 +2586,6 @@ do { ip = &instack[indepth]; \ ...@@ -2586,8 +2586,6 @@ do { ip = &instack[indepth]; \
case '%': case '%':
if (ident_length || ip->macro || traditional) if (ident_length || ip->macro || traditional)
goto randomchar; goto randomchar;
if (ip->fname == 0 && beg_of_line == ip->buf)
goto randomchar;
while (*ibp == '\\' && ibp[1] == '\n') { while (*ibp == '\\' && ibp[1] == '\n') {
ibp += 2; ibp += 2;
++ip->lineno; ++ip->lineno;
...@@ -2618,11 +2616,15 @@ do { ip = &instack[indepth]; \ ...@@ -2618,11 +2616,15 @@ do { ip = &instack[indepth]; \
preprocessor directives. */ preprocessor directives. */
if (ip->macro != 0) if (ip->macro != 0)
goto randomchar; goto randomchar;
/* If this is expand_into_temp_buffer, recognize them /* If this is expand_into_temp_buffer,
don't recognize them either. Warn about them
only after an actual newline at this level, only after an actual newline at this level,
not at the beginning of the input level. */ not at the beginning of the input level. */
if (ip->fname == 0 && beg_of_line == ip->buf) if (! ip->fname) {
if (ip->buf != beg_of_line)
warning ("preprocessing directive not recognized within macro arg");
goto randomchar; goto randomchar;
}
if (ident_length) if (ident_length)
goto specialchar; goto specialchar;
......
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