diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-03-30 07:19:57 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-03-30 07:19:57 -0500 |
commit | 3be5fb2398c72907ddf4ad7df062694c8d08b65c (patch) | |
tree | 9d931abd4c6ac8f0e7bc15fc2d504966d146a8ff /gcc | |
parent | bb1835d25cc7e4d019b8f9c254148c31ef31bbd3 (diff) | |
download | gcc-3be5fb2398c72907ddf4ad7df062694c8d08b65c.zip gcc-3be5fb2398c72907ddf4ad7df062694c8d08b65c.tar.gz gcc-3be5fb2398c72907ddf4ad7df062694c8d08b65c.tar.bz2 |
(rescan): Don't recognize preprocessing directives within macro args.
Warn if one is found.
From-SVN: r9257
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cccp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; |