From 2994a9acb75088ac8d18f70d10963a47c728130a Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 16 Jan 1996 09:33:52 -0500 Subject: [PATCH] (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 --- gcc/cccp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/cccp.c b/gcc/cccp.c index df1735c..1c7f425 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -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; } -- 2.7.4