diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-01-16 09:33:52 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-01-16 09:33:52 -0500 |
commit | 2994a9acb75088ac8d18f70d10963a47c728130a (patch) | |
tree | 0eba7edff8f6718dbc70cd06543570cf533ab49d /gcc | |
parent | e28ea75bd149315cfa085edb86d76755f2a9209d (diff) | |
download | gcc-2994a9acb75088ac8d18f70d10963a47c728130a.zip gcc-2994a9acb75088ac8d18f70d10963a47c728130a.tar.gz gcc-2994a9acb75088ac8d18f70d10963a47c728130a.tar.bz2 |
(skip_quoted_string): If pedantic and not pedantic_errors,
skipped multiline strings elicit a warning, not an error.
(rescan): Minor code reorg to keep it parallel with skip_quoted_string.
From-SVN: r11023
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cccp.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -2876,12 +2876,12 @@ do { ip = &instack[indepth]; \ "unterminated character constant"); goto while2end; } - if (pedantic && multiline_string_line == 0) { - pedwarn_with_line (line_for_error (start_line), - "string constant runs past end of line"); - } - if (multiline_string_line == 0) + if (multiline_string_line == 0) { + if (pedantic) + pedwarn_with_line (line_for_error (start_line), + "string constant runs past end of line"); multiline_string_line = ip->lineno - 1; + } break; case '\\': @@ -7708,7 +7708,7 @@ skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p, *eofp = 1; break; } - if (pedantic || match == '\'') { + if (match == '\'') { error_with_line (line_for_error (start_line), "unterminated string or character constant"); bp--; @@ -7719,8 +7719,12 @@ skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p, /* If not traditional, then allow newlines inside strings. */ if (count_newlines) ++*count_newlines; - if (multiline_string_line == 0) + if (multiline_string_line == 0) { + if (pedantic) + pedwarn_with_line (line_for_error (start_line), + "string constant runs past end of line"); multiline_string_line = start_line; + } } else if (c == match) break; } |