From 3be5fb2398c72907ddf4ad7df062694c8d08b65c Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 30 Mar 1995 07:19:57 -0500 Subject: (rescan): Don't recognize preprocessing directives within macro args. Warn if one is found. From-SVN: r9257 --- gcc/cccp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/cccp.c b/gcc/cccp.c index b4b6ef9..ff8593e 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -2586,8 +2586,6 @@ do { ip = &instack[indepth]; \ case '%': if (ident_length || ip->macro || traditional) goto randomchar; - if (ip->fname == 0 && beg_of_line == ip->buf) - goto randomchar; while (*ibp == '\\' && ibp[1] == '\n') { ibp += 2; ++ip->lineno; @@ -2618,11 +2616,15 @@ do { ip = &instack[indepth]; \ preprocessor directives. */ if (ip->macro != 0) 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, 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; + } if (ident_length) goto specialchar; -- cgit v1.1