]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR preprocessor/7138 (gcc-3.2 failed to compile kernel)
authorNeil Booth <neil@daikokuya.co.uk>
Fri, 28 Jun 2002 06:26:54 +0000 (06:26 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 28 Jun 2002 06:26:54 +0000 (06:26 +0000)
PR preprocessor/7138
* cpplib.c (_cpp_handle_directive): Do traditional
preparation after setting state.angled_headers.
* cpptrad.c (scan_out_logical_line): Fix potential
quote bug.

From-SVN: r55055

gcc/ChangeLog
gcc/cpplib.c
gcc/cpptrad.c

index ab1a59b1859a6e9852b2ba0872ca1a92456e3e60..42ac032fac0c6156b03d0b199594a769f258068e 100644 (file)
@@ -1,3 +1,11 @@
+2002-06-28  Neil Booth  <neil@daikokuya.co.uk>
+
+       PR preprocessor/7138
+       * cpplib.c (_cpp_handle_directive): Do traditional
+       preparation after setting state.angled_headers.
+       * cpptrad.c (scan_out_logical_line): Fix potential
+       quote bug.
+
 2002-06-27  Aldy Hernandez  <aldyh@redhat.com>
 
         * config/rs6000/rs6000.c (rs6000_override_options): Move
index 6bb9f4d1bb2f76a92fb73d0fef21a3ff4abefdd2..f2d33a89e48c17f37318861e38c42229f4674f98 100644 (file)
@@ -388,10 +388,6 @@ _cpp_handle_directive (pfile, indented)
                   "style of line directive is a GCC extension");
     }
 
-  pfile->directive = dir;
-  if (CPP_OPTION (pfile, traditional))
-    prepare_directive_trad (pfile);
-
   if (dir)
     {
       /* If we have a directive that is not an opening conditional,
@@ -442,6 +438,10 @@ _cpp_handle_directive (pfile, indented)
                   cpp_token_as_text (pfile, dname));
     }
 
+  pfile->directive = dir;
+  if (CPP_OPTION (pfile, traditional))
+    prepare_directive_trad (pfile);
+
   if (dir)
     {
       /* If we are processing a `#define' directive and we have been
index 4d07d528de8f6f7d2832bf3358c2224e6df7906b..a72237b87b86c1d55902456a74a4df394e96e692 100644 (file)
@@ -435,12 +435,13 @@ scan_out_logical_line (pfile, macro)
   const uchar *cur;
   uchar *out;
   struct fun_macro fmacro;
-  unsigned int c, paren_depth = 0, quote = 0;
+  unsigned int c, paren_depth = 0, quote;
   enum ls lex_state = ls_none;
 
   fmacro.buff = NULL;
 
  start_logical_line:
+  quote = 0;
   CUR (pfile->context) = pfile->buffer->cur;
   RLIMIT (pfile->context) = pfile->buffer->rlimit;
   pfile->out.cur = pfile->out.base;
@@ -502,7 +503,7 @@ scan_out_logical_line (pfile, macro)
            quote = '>';
          break;
        case '>':
-         if (pfile->state.angled_headers && c == quote)
+         if (c == quote)
            {
              pfile->state.angled_headers = false;
              quote = 0;