(discard_comments): If traditional, replace a comment with nothing
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 8 Dec 1994 19:19:11 +0000 (14:19 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 8 Dec 1994 19:19:11 +0000 (14:19 -0500)
instead of with a space.

From-SVN: r8628

gcc/cccp.c

index fa6d363dea557a84af4a9fe2c0702afbd90a0494..45900f0cad3935ef14458ad8ae023271f9b35b9e 100644 (file)
@@ -8407,8 +8407,12 @@ discard_comments (start, length, newlines)
       }
       if (ibp[0] != '*' || ibp + 1 >= limit)
        break;
-      /* Comments are equivalent to spaces.  */
-      obp[-1] = ' ';
+      /* Comments are equivalent to spaces.
+        For -traditional, a comment is equivalent to nothing.  */
+      if (traditional)
+       obp--;
+      else
+       obp[-1] = ' ';
       ibp++;
       while (ibp + 1 < limit) {
        if (ibp[0] == '*'