aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-12-08 14:19:11 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-12-08 14:19:11 -0500
commitb6d9014380599b256146987362e5bbbf443d065d (patch)
tree17d0b6d146451194440818eb7613fcfe09d80d6d
parentc03413c782ddde861c023ee127a9f24dd1104df9 (diff)
downloadgcc-b6d9014380599b256146987362e5bbbf443d065d.zip
gcc-b6d9014380599b256146987362e5bbbf443d065d.tar.gz
gcc-b6d9014380599b256146987362e5bbbf443d065d.tar.bz2
(discard_comments): If traditional, replace a comment with nothing
instead of with a space. From-SVN: r8628
-rw-r--r--gcc/cccp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index fa6d363..45900f0 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -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] == '*'