From e43a157747ca2a71a4a55c16b2bc6299e9a636c8 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 10 May 2000 19:29:20 +0000 Subject: cppexp.c (lex): Use %.*s to print non-NUL-terminated string. * cppexp.c (lex): Use %.*s to print non-NUL-terminated string. Make error message friendlier. From-SVN: r33829 --- gcc/testsuite/gcc.dg/cpp-if4.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp-if4.c (limited to 'gcc/testsuite/gcc.dg/cpp-if4.c') diff --git a/gcc/testsuite/gcc.dg/cpp-if4.c b/gcc/testsuite/gcc.dg/cpp-if4.c new file mode 100644 index 0000000..84764fb --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp-if4.c @@ -0,0 +1,8 @@ +/* Regression test for proper error message. The token name isn't + NUL terminated, so we would print garbage after it. */ +/* { dg-do compile } */ + +#if 1 += 2 /* { dg-error "'\\+=' is not allowed" "+= in if" } */ +syntax_error +#endif +int foo; -- cgit v1.1