OSDN Git Service

(discard_comments): If traditional, replace a comment with nothing
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Dec 1994 19:19:11 +0000 (19:19 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Dec 1994 19:19:11 +0000 (19:19 +0000)
instead of with a space.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8628 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cccp.c

index fa6d363..45900f0 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] == '*'