aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1995-03-21 01:27:13 +0000
committerDoug Evans <dje@gnu.org>1995-03-21 01:27:13 +0000
commit23f15b0c58c2efaad722345bbf3c5924a5b72b35 (patch)
tree32a9d8aec72500d80bd79521874a79bd0c2272d8 /gcc
parentf0959e58ca77e179cb34859e32a1260b01b51cce (diff)
downloadgcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.zip
gcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.tar.gz
gcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.tar.bz2
(do_xifdef): Handle c++ comments.
(do_endif): Likewise. From-SVN: r9214
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index e88d2f7..fb1e6fd 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -6953,7 +6953,11 @@ do_xifdef (buf, limit, op, keyword)
U_CHAR c = *p++;
if (is_space[c])
;
- else if (c == '/' && p != ip->bufp && *p == '*') {
+ /* ??? Why is the test with ip->bufp here? */
+ /* ??? We don't handle \-n inside /-*. */
+ /* ??? Comment handling in general could use a major cleanup. */
+ else if (c == '/' && p != ip->bufp
+ && (*p == '*' || (cplusplus_comments && *p == '/'))) {
/* Skip this comment. */
int junk = 0;
U_CHAR *save_bufp = ip->bufp;
@@ -7410,7 +7414,8 @@ do_endif (buf, limit, op, keyword)
while (p != ep) {
U_CHAR c = *p++;
if (!is_space[c]) {
- if (c == '/' && p != ep && *p == '*') {
+ if (c == '/' && p != ep
+ && (*p == '*' || (cplusplus_comments && *p == '/'))) {
/* Skip this comment. */
int junk = 0;
U_CHAR *save_bufp = ip->bufp;