From: Mike Frysinger <vapier@gentoo.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Andrew Burgess <aburgess@redhat.com>,
Simon Marchi <simon.marchi@efficios.com>,
gdb-patches@sourceware.org
Subject: Re: gdb: disable -Wmissing-prototypes warning w/gcc
Date: Thu, 4 Nov 2021 16:18:02 -0400 [thread overview]
Message-ID: <YYQ/+murNcypAucu@vapier> (raw)
In-Reply-To: <543b67d0-07de-13db-5f73-0f74cc315174@polymtl.ca>
[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]
On 04 Nov 2021 14:43, Simon Marchi via Gdb-patches wrote:
> > Just wondering, does anybody care about building GDB with a compiler
> > other than GCC and Clang? Because another way that excludes the warning
> > just for gcc (rather than include it for anything that isn't gcc) would
> > be (in pseudo code):
> >
> > diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4
> > index 46036fa461e8..33a729a60d5d 100644
> > --- a/gdbsupport/warning.m4
> > +++ b/gdbsupport/warning.m4
> > @@ -150,7 +150,7 @@ then
> > [WARN_CFLAGS="${WARN_CFLAGS} $w"],
> > []
> > )
> > - else
> > + elif (compiler is not gcc) or (warning is not -Wmissing-prototypes); then
> > AC_COMPILE_IFELSE(
> > [AC_LANG_PROGRAM([], [])],
> > [WARN_CFLAGS="${WARN_CFLAGS} $w"],
> >
> > If that works, I think it would be preferable, but otherwise I think
> > your patch is OK. Please push whatever makes the most sense to you, so
> > we can finally get rid of this warning :).
>
> Hmm, actually using $GCC doesn't work: it gets set to yes even when
> building with clang. I think it means more "does the compiler supports
> the GNU extension", which the clang compiler supports, for the most
> part. And the goal is to have -Wmissing-prototypes when building with
> clang.
we could invert the logic: only add the flag if it's clang.
we can test for clang via --version grep or a __clang__ preproc test.
-mike
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-11-04 20:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 22:34 [PATCH] gdb: enable -Wmissing-prototypes warning Simon Marchi
2020-03-11 19:16 ` Simon Marchi
2021-11-04 12:00 ` gdb: disable -Wmissing-prototypes warning w/gcc Mike Frysinger
2021-11-04 12:17 ` Andrew Burgess
2021-11-04 12:59 ` Simon Marchi
2021-11-04 18:43 ` Simon Marchi
2021-11-04 20:18 ` Mike Frysinger [this message]
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=YYQ/+murNcypAucu@vapier \
--to=vapier@gentoo.org \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/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).