OSDN Git Service

* skip_whitespace: Rearrange to avoid stage1 ICE.
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Apr 2003 07:41:15 +0000 (07:41 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Apr 2003 07:41:15 +0000 (07:41 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65809 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cpplex.c

index 930e887..ce9a8d4 100644 (file)
@@ -334,7 +334,7 @@ skip_whitespace (pfile, c)
      cppchar_t c;
 {
   cpp_buffer *buffer = pfile->buffer;
-  unsigned int warned = 0;
+  bool saw_NUL = false;
 
   do
     {
@@ -343,13 +343,7 @@ skip_whitespace (pfile, c)
        ;
       /* Just \f \v or \0 left.  */
       else if (c == '\0')
-       {
-         if (!warned)
-           {
-             cpp_error (pfile, DL_WARNING, "null character(s) ignored");
-             warned = 1;
-           }
-       }
+       saw_NUL = true;
       else if (pfile->state.in_directive && CPP_PEDANTIC (pfile))
        cpp_error_with_line (pfile, DL_PEDWARN, pfile->line,
                             CPP_BUF_COL (buffer),
@@ -361,6 +355,9 @@ skip_whitespace (pfile, c)
   /* We only want non-vertical space, i.e. ' ' \t \f \v \0.  */
   while (is_nvspace (c));
 
+  if (saw_NUL)
+    cpp_error (pfile, DL_WARNING, "null character(s) ignored");
+
   buffer->cur--;
 }