aboutsummaryrefslogtreecommitdiff
path: root/libcpp/lex.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2006-09-13 02:04:18 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2006-09-13 02:04:18 +0100
commitc663e301034033aa098dd63b3d141c8edb51c223 (patch)
tree7bc68cc714505a842f95c6794e5a70120ccf250d /libcpp/lex.c
parent48de786822a56dbfc3d434c13d19d3dd91aa801e (diff)
downloadgcc-c663e301034033aa098dd63b3d141c8edb51c223.zip
gcc-c663e301034033aa098dd63b3d141c8edb51c223.tar.gz
gcc-c663e301034033aa098dd63b3d141c8edb51c223.tar.bz2
re PR c/28768 (Preprocessor doesn't parse tokens correctly?)
libcpp: PR c/28768 PR preprocessor/14634 * lex.c (lex_string): Pedwarn for unterminated literals. libgomp: * configure.ac (HAVE_CLOCK_GETTIME): Add missing second argument to AC_DEFINE. * configure: Regenerate. gcc/testsuite: * gcc.dg/cpp/include2.c, gcc.dg/cpp/macspace1.c, gcc.dg/cpp/macspace2.c, gcc.dg/cpp/multiline.c, gcc.dg/cpp/trad/literals-2.c: Update expected diagnostics. From-SVN: r116915
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r--libcpp/lex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c
index 6dc0fd9..df09bd6 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -646,6 +646,10 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
cpp_error (pfile, CPP_DL_WARNING,
"null character(s) preserved in literal");
+ if (type == CPP_OTHER && CPP_OPTION (pfile, lang) != CLK_ASM)
+ cpp_error (pfile, CPP_DL_PEDWARN, "missing terminating %c character",
+ (int) terminator);
+
pfile->buffer->cur = cur;
create_literal (pfile, token, base, cur - base, type);
}