aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp-tradwarn1.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-02 22:50:55 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-02 22:50:55 +0000
commitbfab56e7ab02ea2616f98cdd1681a5dcc078e189 (patch)
treeb00fb305180d6ad00464b0f8d26982c399a9faa0 /gcc/testsuite/gcc.dg/cpp-tradwarn1.c
parent7c3bb1deecbcda27683c0fccca91987b32eb292e (diff)
downloadgcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.zip
gcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.tar.gz
gcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.tar.bz2
cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++.
* cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++. * cpplib.c (_cpp_handle_directive): Improve warnings for traditional C and indented directives. * enquire.c, gsyslimits.h, limity.h, config/convex/fixinc.convex, fixinc/fixinc.irix, fixinc/fixinc.sco, fixinc/fixinc.wrap, fixinc/inclhack.def: Indent the # of #include_next one space. * cp/rtti.c: Un-indent #if and #endif. * cppexp.c (_cpp_parse_expr): If lex returns '#', it's a syntax error, but an error has already been printed. * cpplex.c (_cpp_parse_assertion): Give a more specific error message when called with nothing remaining on the line. (_cpp_lex_token): If _cpp_parse_assertion fails, return an OTHER token, not an ASSERTION. * cpplib.c (do_assert): When we create a 'base' node, clear its aschain pointer. * gcc.c-torture/compile/981211-1.c: Move to... * gcc.dg/cpp-as1.c: ...here. * gcc.dg/cpp-as2.c: New file. * gcc.dg/cpp-tradwarn1.c: Change warning regexps to match the compiler. From-SVN: r32870
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-tradwarn1.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-tradwarn1.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-tradwarn1.c b/gcc/testsuite/gcc.dg/cpp-tradwarn1.c
index 8395c80..9085ea6 100644
--- a/gcc/testsuite/gcc.dg/cpp-tradwarn1.c
+++ b/gcc/testsuite/gcc.dg/cpp-tradwarn1.c
@@ -2,27 +2,27 @@
/* { dg-do preprocess } */
/* { dg-options "-pedantic -Wtraditional" } */
-/* Block 1: K+R directives should have the # at the left margin. */
+/* Block 1: K+R directives should have the # indented. */
-#define foo bar /* { dg-bogus "left margin" "^#kandr" } */
-# define foo bar /* { dg-bogus "left margin" "^# kandr" } */
- #define foo bar /* { dg-warning "left margin" "^ #kandr" } */
- # define foo bar /* { dg-warning "left margin" "^ # kandr" } */
+#define foo bar /* { dg-bogus "indented" "^#kandr" } */
+# define foo bar /* { dg-bogus "indented" "^# kandr" } */
+ #define foo bar /* { dg-warning "indented" "^ #kandr" } */
+ # define foo bar /* { dg-warning "indented" "^ # kandr" } */
-/* Block 2: C89 directives should not have the # at the left margin. */
+/* Block 2: C89 directives should not have the # indented. */
-#pragma whatever /* { dg-warning "left margin" "^#c89" } */
-# pragma whatever /* { dg-warning "left margin" "^# c89" } */
- #pragma whatever /* { dg-bogus "left margin" "^ #c89" } */
- # pragma whatever /* { dg-bogus "left margin" "^ # c89" } */
+#pragma whatever /* { dg-warning "indented" "^#c89" } */
+# pragma whatever /* { dg-warning "indented" "^# c89" } */
+ #pragma whatever /* { dg-bogus "indented" "^ #c89" } */
+ # pragma whatever /* { dg-bogus "indented" "^ # c89" } */
-/* Block 3: Extensions should not have the # at the left margin,
+/* Block 3: Extensions should not have the # indented,
_and_ they should get a -pedantic warning. */
-#assert foo(bar) /* { dg-warning "left margin" "^#ext" } */
-# assert bar(baz) /* { dg-warning "left margin" "^# ext" } */
- #assert baz(quux) /* { dg-bogus "left margin" "^ #ext" } */
- # assert quux(weeble) /* { dg-bogus "left margin" "^ # ext" } */
+#assert foo(bar) /* { dg-warning "indented" "^#ext" } */
+# assert bar(baz) /* { dg-warning "indented" "^# ext" } */
+ #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+ # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
/* { dg-warning "ISO C does not" "extension warning" { target native } 22 } */
/* { dg-warning "ISO C does not" "extension warning" { target native } 23 } */