and/or warnings. */
static int done_initializing = 0;
+
+/* Line where a newline was first seen in a string constant. */
+
+static int multiline_string_line = 0;
\f
/* I/O buffer structure.
The `fname' field is nonzero for source files and #include files
this records the line it started on, for error messages. */
int start_line;
- /* Line where a newline was first seen in a string constant. */
- int multiline_string_line = 0;
-
/* Record position of last `real' newline. */
U_CHAR *beg_of_line;
if (bp >= limit) {
error_with_line (line_for_error (start_line),
"unterminated string or character constant");
+ error_with_line (multiline_string_line,
+ "possible real start of unterminated constant");
+ multiline_string_line = 0;
if (eofp)
*eofp = 1;
break;
*eofp = 1;
break;
}
- if (match == '\'') {
+ if (pedantic || match == '\'') {
error_with_line (line_for_error (start_line),
- "unterminated character constant");
+ "unterminated string or character constant");
bp--;
if (eofp)
*eofp = 1;
break;
}
- if (traditional) { /* Unterminated strings are 'legal'. */
- if (eofp)
- *eofp = 1;
- break;
- }
/* If not traditional, then allow newlines inside strings. */
if (count_newlines)
++*count_newlines;
+ if (multiline_string_line == 0)
+ multiline_string_line = start_line;
} else if (c == match)
break;
}