aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-03-30 07:19:57 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-03-30 07:19:57 -0500
commit3be5fb2398c72907ddf4ad7df062694c8d08b65c (patch)
tree9d931abd4c6ac8f0e7bc15fc2d504966d146a8ff
parentbb1835d25cc7e4d019b8f9c254148c31ef31bbd3 (diff)
downloadgcc-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
-rw-r--r--gcc/cccp.c10
1 files changed, 6 insertions, 4 deletions
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;