Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: 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 14:43:13 -0400	[thread overview]
Message-ID: <543b67d0-07de-13db-5f73-0f74cc315174@polymtl.ca> (raw)
In-Reply-To: <32f7539b-55e6-80c4-0032-a41532eeb933@polymtl.ca>

> 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 :).
> 
> Simon
> 

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.

Simon

  reply	other threads:[~2021-11-04 18:43 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 via Gdb-patches
2021-11-04 12:17   ` Andrew Burgess via Gdb-patches
2021-11-04 12:59     ` Simon Marchi via Gdb-patches
2021-11-04 18:43       ` Simon Marchi via Gdb-patches [this message]
2021-11-04 20:18         ` Mike Frysinger via Gdb-patches

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=543b67d0-07de-13db-5f73-0f74cc315174@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=aburgess@redhat.com \
    --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