From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cGHwI+vLg2HVbAAAWB0awg (envelope-from ) for ; Thu, 04 Nov 2021 08:02:51 -0400 Received: by simark.ca (Postfix, from userid 112) id 7B32B1F0C1; Thu, 4 Nov 2021 08:02:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C24051E813 for ; Thu, 4 Nov 2021 08:02:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 36D593858005 for ; Thu, 4 Nov 2021 12:02:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36D593858005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636027370; bh=y2LbxBPtmTneR6FsCTqdz46XKAwT+MFhW2I2zK+yAFY=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HROKE0o06ebkSlwV8wPtBzl7zla8iDGhoL69gNa05LFRQ1dxW5l6i/I2TKMI93XvM mdCTEK9qMUxEnvmiYsVZnL8YNWFZZ/RvKhUBbe/RgR4EXF+2BQ3Bw+2SZbL4ECk/Wg PRkzudXGa9TSsSor3Pk4gx2SK4ibdBZ+F3uqE/jY= Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id D1F3A3857C40 for ; Thu, 4 Nov 2021 12:00:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D1F3A3857C40 Received: by smtp.gentoo.org (Postfix, from userid 559) id 61B7F342EB0; Thu, 4 Nov 2021 12:00:55 +0000 (UTC) Date: Thu, 4 Nov 2021 08:00:53 -0400 To: Simon Marchi Subject: gdb: disable -Wmissing-prototypes warning w/gcc Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20200303223442.330-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6UC8yx/3912e/Pod" Content-Disposition: inline In-Reply-To: <20200303223442.330-1-simon.marchi@efficios.com> 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: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --6UC8yx/3912e/Pod Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03 Mar 2020 17:34, Simon Marchi wrote: > While compiling with clang, I noticed it didn't catch cases where my > function declaration didn't match my function definition. This is > normally caught by gcc with -Wmissing-declarations. >=20 > On clang, this is caught by -Wmissing-prototypes instead. >=20 > Note that on gcc, -Wmissing-prototypes also exists, but is only valid > for C and Objective-C. It gets correctly rejected by the configure > script since gcc rejects it with: >=20 > cc1plus: error: command line option '-Wmissing-prototypes' is valid f= or C/ObjC but not for C++ -Werror >=20 > So this warning flag ends up not used for gcc (which is what we want). so ccache has a long standing bug where it mishandles -Werror with other -W options causing the configure test to pass when it shouldn't. https://github.com/ccache/ccache/issues/738 that means ccache+gcc builds of gdb are full of annoying logs: CXX cli/cli-decode.o cc1plus: warning: command-line option =E2=80=98-Wmissing-prototypes=E2=80= =99 is valid for C/ObjC but not for C++ i get that the configure script here isn't wrong, but there aren't any knobs in here that i can tweak to workaround the issue either, and i'm trying to avoid carrying patches in all my local branches, and configure files are kind of meant to deal with all sorts of system warts. so random terrible idea below. -mike --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -51,10 +51,15 @@ build_warnings=3D"-Wall -Wpointer-arith \ -Wdeprecated-copy-dtor \ -Wredundant-move \ -Wmissing-declarations \ --Wmissing-prototypes \ -Wstrict-null-sentinel \ " =20 +# GCC doesn't support this flag currently, and probing via ccache breaks. +# https://github.com/ccache/ccache/issues/738 +if test "${GCC}" !=3D yes ; then + build_warnings=3D"$build_warnings -Wmissing-prototypes" +fi + case "${host}" in *-*-mingw32*) # Enable -Wno-format by default when using gcc on mingw since many --6UC8yx/3912e/Pod Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmGDy3UACgkQQWM7n+g3 9YH7PA/+PyFXe4R1TQX6YONH6iiyEiPePPywjUhISsJRvBtVPJmkvIqsRBrYZGM7 vgnIIbIqUvAiyduxH+hy70OEARnk3BY4MrFHe9Vn+KU7fKyMukex1mv3C0W7LmOR S9ZflvPpaYyR9ybduHVJOryNcepXvN9oKzJGQzQuvC1ItJUeXzWdbMrUziJC8d15 ddT1Jx3YO9bCSpM5xynYc9s+s7HbtEUXNzxgyW55f2rpGZ6LkXz/rp5x8YcMIpKV 3gc4rMmaNCGCM0rtZP/zdjjT3dZPancE3a9X/nE1eX5Xjd/3ned7IKy02Ans6p6k MhqqSMh6aEI8M+b6FLrOWz6AHq7LqbqEUnOzjwgz82ND3teCSoiTCb5horNtbgpe Y3UiAaDgQCZG7HhwccHDb00I8i9QpgcAtX2Vy6HinVdSibf07qAviuwkxJIkhqsw Awqq2B3JVcoE1W3s1rY530bFuaj9J24rRNnRGXzBoIdx7oJuSJQTdBw0xWlCwPto Kyl+jCGZgoHBZ2w9WdWXLzYzcf/rfv/Rcsd9ghzFfqhPvEf98CxEnfXoWdt6yPe9 Y22cHB5amRiFYKGdkVUYaq0NPVn7+q8U6XD1kgRMoExwHtAcpdmQpl451IjEdXpQ 2uD7puCxnpVvUe9P93gIJmXbNc38E+WE0A2X2np7NvAn9cjxjE4= =ult+ -----END PGP SIGNATURE----- --6UC8yx/3912e/Pod--