public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] gcc.dg/Wmissing-parameter-type*: Test the intended warning
Date: Wed, 08 Nov 2023 09:53:20 +0100	[thread overview]
Message-ID: <877cmsaanz.fsf@oldenburg.str.redhat.com> (raw)

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(-)

diff --git a/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c b/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c
index 37e1a571bda..2cd28a2ecd1 100644
--- a/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c
+++ b/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c
@@ -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\\\]" } */
 
 
diff --git a/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c b/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c
index 8ec94e2caf7..b25e8d21602 100644
--- a/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c
+++ b/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c
@@ -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\\\]" } */
 
 

base-commit: e9107464bb24f77038ad042ba858abed4ca060c0


             reply	other threads:[~2023-11-08  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08  8:53 Florian Weimer [this message]
2023-11-08 15:00 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cmsaanz.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).