Re: gdb: disable -Wmissing-prototypes warning w/gcc

Simon Marchi via Gdb-patches
2021-11-04T18:43:42Z

> 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