From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 97D93383F84F for ; Tue, 16 Jun 2020 12:42:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97D93383F84F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-cgAtTJ3dOTmTmAAYxx_tiQ-1; Tue, 16 Jun 2020 08:42:14 -0400 X-MC-Unique: cgAtTJ3dOTmTmAAYxx_tiQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99FE010AB673; Tue, 16 Jun 2020 12:42:13 +0000 (UTC) Received: from blade.nx (ovpn-114-126.ams2.redhat.com [10.36.114.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A6725D9D3; Tue, 16 Jun 2020 12:42:13 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id 88644816CCA9; Tue, 16 Jun 2020 13:42:12 +0100 (BST) Date: Tue, 16 Jun 2020 13:42:12 +0100 From: Gary Benson To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [OB PATCH] Build two gdb.cp testcases with -Wno-unused-comparison Message-ID: <20200616124212.GB30305@blade.nx> References: <1590757423-18004-1-git-send-email-gbenson@redhat.com> <87mu5qaa2b.fsf@tromey.com> <68fd1b3e-10ae-8f1d-b96d-f35ce7ae3037@redhat.com> MIME-Version: 1.0 In-Reply-To: <68fd1b3e-10ae-8f1d-b96d-f35ce7ae3037@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 16 Jun 2020 12:42:17 -0000 Pedro Alves wrote: > On 5/29/20 7:08 PM, Tom Tromey wrote: > >>>>>> "Gary" == Gary Benson via Gdb-patches writes: > > > > Gary> +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ > > Gary> + {debug c++ additional_flags=-Wno-unused-comparison}] } { > > > > Won't this cause build (and therefore test) failures if the compiler > > does not accept this option? > > I think that by design, while GCC errors out about unknown -Wfoo warnings, > it ignores -Wno-foo, so that you can disable newer warnings without worrying > about older compilers: > > $ gcc main.c -o main -g3 -O0 -Wfoo > gcc: error: unrecognized command line option ‘-Wfoo’ > $ gcc main.c -o main -g3 -O0 -Wno-foo Nice. > However, Clang seems to output a warning in either case: > > $ clang main.c -o main -g3 -O0 -Wfoo > warning: unknown warning option '-Wfoo' [-Wunknown-warning-option] > 1 warning generated. > $ clang main.c -o main -g3 -O0 -Wno-foo > warning: unknown warning option '-Wno-foo' [-Wunknown-warning-option] > 1 warning generated. > > (This was clang 5.0.2) > > So that new option can break tests with older Clangs that don't > know about the option. Ugh. clang 9.0.1 behaves the same too: $ clang -Werror -Wno-step-on-grass test.c error: unknown warning option '-Wno-step-on-grass' [-Werror,-Wunknown-warning-option] > I guess to prevent this sort of thing going forward, we could make > gcc_compile always add -Wno-unknown-warning-option to the build > flags. I don't know when was that option added to Clang, but maybe > it's ancient enough. Does this buy us much? Any test with a warning I disable for clang is a test that didn't compile with clang anyway. Cheers, Gary