From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 60B1B3858439 for ; Thu, 4 Nov 2021 20:18:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60B1B3858439 Received: by smtp.gentoo.org (Postfix, from userid 559) id DD91F342F44; Thu, 4 Nov 2021 20:18:03 +0000 (UTC) Date: Thu, 4 Nov 2021 16:18:02 -0400 From: Mike Frysinger To: Simon Marchi Cc: Andrew Burgess , Simon Marchi , gdb-patches@sourceware.org Subject: Re: gdb: disable -Wmissing-prototypes warning w/gcc Message-ID: Mail-Followup-To: Simon Marchi , Andrew Burgess , Simon Marchi , gdb-patches@sourceware.org References: <20200303223442.330-1-simon.marchi@efficios.com> <20211104121716.GE918204@redhat.com> <32f7539b-55e6-80c4-0032-a41532eeb933@polymtl.ca> <543b67d0-07de-13db-5f73-0f74cc315174@polymtl.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PE4lEN+eDV50C+V9" Content-Disposition: inline In-Reply-To: <543b67d0-07de-13db-5f73-0f74cc315174@polymtl.ca> X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 20:18:06 -0000 --PE4lEN+eDV50C+V9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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): > >=20 > > 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=3D"${WARN_CFLAGS} $w"], > > [] > > ) > > - else > > + elif (compiler is not gcc) or (warning is not -Wmissing-prototype= s); then > > AC_COMPILE_IFELSE( > > [AC_LANG_PROGRAM([], [])], > > [WARN_CFLAGS=3D"${WARN_CFLAGS} $w"], > >=20 > > 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 :). >=20 > 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 --PE4lEN+eDV50C+V9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmGEP/oACgkQQWM7n+g3 9YHNqhAA3eoJkwWHvOu4P/RtfAPa0SOtjclcl/EKMXJk9pF0AzHFfKnT/P8h5cKD EVdBwlLR5VoHdJTzaX7LxceLv/ctI6kzw+Iu0BIEFpfJ+swFAKbMvfk1tXX1j/bm ZXVEodiPTRqzHnAGGYnYL2i7krWyNcgZkzLg+PI3TiCukYpbJxd+zdwc0Y0qzX1o bSaNWwJl3gTn6vdLLYv9IO9JutBDg8sVT3SkXHB9/XtdLM+sKiZIjDy3jPvrCy0V VHhR6PVd1dyD5lzeJqKRytutHzLT0F6e0AYz5tlMCvT+/j7DsT6ZgYWu62fSXVuP djXbC7Ejco2IqZ2QZ/CSKeG757RUVy7AEfx6RLsRWwoQK8AGi+F59XFtHa8vjKab +eR20zj2iIf4UNDbe4WanVYrQ6KMUp9XOinoeQE66f914tY0FBDWb2hLsEBSy1RL Qs87I9ENrrRFRbJ2Fqx1L50afpijPBHeGWKoqECo3IljNirfKRuuqY+b2nuR3UM+ YLWQ04xVCwqkjB+7E9Au4vNpt9MLkRgRu+DG++oqrVoF4m36EEwIQG8glOk+YxWB JgePbP7yDqVoMZDQgNckf62A30Y/NHdLjxCkqJp1igtuZdB3lnRkM6AcsW+qEUS7 TUMDUEhHGlzTFP01/Ftaz48s5xxIqgrTyEFQhP2BwinsPeeHy2A= =4DUf -----END PGP SIGNATURE----- --PE4lEN+eDV50C+V9--