gcc.dg/Wmissing-parameter-type*: Test the intended warning
Checks
Commit Message
gcc/testsuite/ChangeLog:
* gcc.dg/Wmissing-parameter-type.c: Build with -std=gnu89
to trigger the -Wmissing-parameter-type warning
and not the default -Wimplicit warning. Also match
against -Wmissing-parameter-type.
* gcc.dg/Wmissing-parameter-type.c: Likewise.
---
gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c | 4 ++--
gcc/testsuite/gcc.dg/Wmissing-parameter-type.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
base-commit: e9107464bb24f77038ad042ba858abed4ca060c0
@@ -1,7 +1,7 @@
/* Test -Wmissing-parameter-type is enabled by -Wextra */
/* { dg-do compile } */
-/* { dg-options "-Wextra" } */
+/* { dg-options "-std=gnu89 -Wextra" } */
-int foo(bar) { return bar;} /* { dg-warning "type of 'bar' defaults to 'int'" } */
+int foo(bar) { return bar;} /* { dg-warning "type of 'bar' defaults to 'int' \\\[-Wmissing-parameter-type\\\]" } */
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-Wmissing-parameter-type" } */
+/* { dg-options "-std=gnu89 -Wmissing-parameter-type" } */
-int foo(bar) { return bar; } /* { dg-warning "type of 'bar' defaults to 'int'" } */
+int foo(bar) { return bar; } /* { dg-warning "type of 'bar' defaults to 'int' \\\[-Wmissing-parameter-type\\\]" } */