Commit f7d151fb by Neil Booth

* skip_whitespace: Rearrange to avoid stage1 ICE.

From-SVN: r65809
parent 26aea073
...@@ -334,7 +334,7 @@ skip_whitespace (pfile, c) ...@@ -334,7 +334,7 @@ skip_whitespace (pfile, c)
cppchar_t c; cppchar_t c;
{ {
cpp_buffer *buffer = pfile->buffer; cpp_buffer *buffer = pfile->buffer;
unsigned int warned = 0; bool saw_NUL = false;
do do
{ {
...@@ -343,13 +343,7 @@ skip_whitespace (pfile, c) ...@@ -343,13 +343,7 @@ skip_whitespace (pfile, c)
; ;
/* Just \f \v or \0 left. */ /* Just \f \v or \0 left. */
else if (c == '\0') else if (c == '\0')
{ saw_NUL = true;
if (!warned)
{
cpp_error (pfile, DL_WARNING, "null character(s) ignored");
warned = 1;
}
}
else if (pfile->state.in_directive && CPP_PEDANTIC (pfile)) else if (pfile->state.in_directive && CPP_PEDANTIC (pfile))
cpp_error_with_line (pfile, DL_PEDWARN, pfile->line, cpp_error_with_line (pfile, DL_PEDWARN, pfile->line,
CPP_BUF_COL (buffer), CPP_BUF_COL (buffer),
...@@ -361,6 +355,9 @@ skip_whitespace (pfile, c) ...@@ -361,6 +355,9 @@ skip_whitespace (pfile, c)
/* We only want non-vertical space, i.e. ' ' \t \f \v \0. */ /* We only want non-vertical space, i.e. ' ' \t \f \v \0. */
while (is_nvspace (c)); while (is_nvspace (c));
if (saw_NUL)
cpp_error (pfile, DL_WARNING, "null character(s) ignored");
buffer->cur--; buffer->cur--;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment