From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 338B5385840A for ; Thu, 4 Nov 2021 12:17:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 338B5385840A Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-Pyt0v9_IOp2bCt7xOaIZ3g-1; Thu, 04 Nov 2021 08:17:19 -0400 X-MC-Unique: Pyt0v9_IOp2bCt7xOaIZ3g-1 Received: by mail-ed1-f72.google.com with SMTP id y20-20020a056402359400b003e28c9bc02cso5562093edc.9 for ; Thu, 04 Nov 2021 05:17:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Gojm36Oj4vQkxsbgfQWNLQB5Vfa3S6dy0M8StmUqi80=; b=wcvEhr0NJbAP3tJ8jpmMD7sHldGEZ3RV4Fx7TJ468qekHja4R4l6ivj9mDGkMJWgXG QG8SK/IVg+aGvcmKGH5h0KZtjosLcGLeLOoMUMRZLt8LRRVaeGMzI2Az46+RTe1K6GnO B96UiNhfUwU5buU1khqtCBzo99CvI9m0csfHWdOLB9VhurMMyFrRXiCwRQbF6wCWRvkA kXEAl/M+94fa/96FhGxVhJkUEk1/nmh+kroFgwl2wrfbPxKtLOUQdAkEV3hhiqiF/ozF XCLteYoXDvGO2266rYNriOPiIHKdmVCOvmpf/xsrwkRzyvYzN6sZjkxj+otpuJymm6+1 gFaA== X-Gm-Message-State: AOAM532gTvtymG+fqb4PZwiY6jh7N2NrhaiHxrYuAkPYY657TxNbPXlP fjRUsuOBHBGoexrca2ieFzHFslyoH90TCqGQRv9s4aEjHpc0l6XY/0k6KNNP+ktnkz1ozZ9dR/L jYj8qC5JA4iT0F/gqsvs0AQ== X-Received: by 2002:aa7:c053:: with SMTP id k19mr67710775edo.293.1636028238280; Thu, 04 Nov 2021 05:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRQNgY8NxgoxILpMP3t82OPwuqY+clrkNlqZADG3+JPs82k9nZySpMS+Q8qc/+lNiuh8pWXw== X-Received: by 2002:aa7:c053:: with SMTP id k19mr67710751edo.293.1636028238071; Thu, 04 Nov 2021 05:17:18 -0700 (PDT) Received: from localhost (host86-166-129-255.range86-166.btcentralplus.com. [86.166.129.255]) by smtp.gmail.com with ESMTPSA id m14sm2696402edc.36.2021.11.04.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 05:17:17 -0700 (PDT) Date: Thu, 4 Nov 2021 12:17:16 +0000 From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: gdb: disable -Wmissing-prototypes warning w/gcc Message-ID: <20211104121716.GE918204@redhat.com> References: <20200303223442.330-1-simon.marchi@efficios.com> MIME-Version: 1.0 In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 12:13:59 up 3 days, 2:47, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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 12:17:23 -0000 * Mike Frysinger via Gdb-patches [2021-11-04 0= 8:00:53 -0400]: > 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= for C/ObjC but not for C++ -Werror > >=20 > > So this warning flag ends up not used for gcc (which is what we want). >=20 > 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 >=20 > 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++ >=20 > 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. >=20 > so random terrible idea below. > -mike >=20 > --- 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 I also tried to solve this issue, but went in a different direction: https://sourceware.org/pipermail/gdb-patches/2021-September/182148.html However, Pedro objected. He would prefer to see a solution exactly like you proposed above. The only reason I didn't immediately knock out a patch was that I didn't know how to check if GCC was the compiler or not. Turns out it's pretty easy :) So, what you wrote gets my +1, and based on the feedback on my thread, I don't think anyone else will object. Thanks, Andrew