]> gcc.gnu.org Git - gcc.git/commitdiff
(skip_if_group): Check for traditional mode when skipping ahead to
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 3 Sep 1993 22:03:32 +0000 (18:03 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 3 Sep 1993 22:03:32 +0000 (18:03 -0400)
next #, ignore unless at beginning of line.

From-SVN: r5257

gcc/cccp.c

index 02035e4bb1c9c2ca0a2bf9f685b977c8f5d057ed..3be2bfa1799a15f6c829d08316dffce1981428a7 100644 (file)
@@ -1,5 +1,5 @@
 /* C Compatible Compiler Preprocessor (CCCP)
-Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+Copyright (C) 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
                     Written by Paul Rubin, June 1986
                    Adapted to ANSI C, Richard Stallman, Jan 1987
 
@@ -6429,22 +6429,24 @@ skip_if_group (ip, any)
         and backslash-newlines, and see if we reach this #.
         If not, this # is not special.  */
       bp = beg_of_line;
-      while (1) {
-       if (is_hor_space[*bp])
-         bp++;
-       else if (*bp == '\\' && bp[1] == '\n')
-         bp += 2;
-       else if (*bp == '/' && bp[1] == '*') {
-         bp += 2;
-         while (!(*bp == '*' && bp[1] == '/'))
+      /* If -traditional, require # to be at beginning of line.  */
+      if (!traditional)
+       while (1) {
+         if (is_hor_space[*bp])
            bp++;
-         bp += 2;
-       } else if (cplusplus_comments && *bp == '/' && bp[1] == '/') {
-         bp += 2;
-         while (*bp++ != '\n') ;
-        }
-       else break;
-      }
+         else if (*bp == '\\' && bp[1] == '\n')
+           bp += 2;
+         else if (*bp == '/' && bp[1] == '*') {
+           bp += 2;
+           while (!(*bp == '*' && bp[1] == '/'))
+             bp++;
+           bp += 2;
+         } else if (cplusplus_comments && *bp == '/' && bp[1] == '/') {
+           bp += 2;
+           while (*bp++ != '\n') ;
+         }
+         else break;
+       }
       if (bp != ip->bufp) {
        bp = ip->bufp + 1;      /* Reset bp to after the #.  */
        break;
This page took 0.069903 seconds and 5 git commands to generate.