(rescan): Don't expand an identifier after a '#'.
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 5 Oct 1993 20:04:55 +0000 (16:04 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 5 Oct 1993 20:04:55 +0000 (16:04 -0400)
From-SVN: r5611

gcc/cccp.c

index ebd8416b93152ab6c51418ec079d93751201883a..e1a654e34e3dd78608558e04a1f65301b05918c6 100644 (file)
@@ -2465,6 +2465,15 @@ do { ip = &instack[indepth];             \
          break;
        }
        ++obp;          /* Copy the '#' after all */
+       /* Don't expand an identifier that could be a macro directive.
+          (Section 3.8.3 of the ANSI C standard)                       */
+       SKIP_WHITE_SPACE (ibp);
+       if (is_idstart[*ibp])
+         {
+           *obp++ = *ibp++;
+           while (is_idchar[*ibp])
+             *obp++ = *ibp++;
+         }
        goto randomchar;
       }
 #ifdef USE_C_ALLOCA