From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id E7C70383F84F for ; Tue, 16 Jun 2020 12:38:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7C70383F84F 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-221-HyB4L_-3MCSLxn_nzDJtJw-1; Tue, 16 Jun 2020 08:38:22 -0400 X-MC-Unique: HyB4L_-3MCSLxn_nzDJtJw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74E26101C2C1; Tue, 16 Jun 2020 12:38:21 +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 36B9C1001B07; Tue, 16 Jun 2020 12:38:21 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id 698C4816CCA9; Tue, 16 Jun 2020 13:38:20 +0100 (BST) Date: Tue, 16 Jun 2020 13:38:20 +0100 From: Gary Benson To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [OB PATCH] Build two gdb.cp testcases with -Wno-unused-comparison Message-ID: <20200616123820.GA30305@blade.nx> References: <1590757423-18004-1-git-send-email-gbenson@redhat.com> <87mu5qaa2b.fsf@tromey.com> MIME-Version: 1.0 In-Reply-To: <87mu5qaa2b.fsf@tromey.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-10.9 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_H4, 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:38:26 -0000 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 wonder if there's a way to fix the warning in the C++ source file > instead. Yes, ideally, but by no means always. I'm working my way through these failures, and in many cases the "issue" the warning caught was intended, some weird thing placed specifically to test some functionality of GDB. For example: Running /gdbtest/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.cp/ambiguous.exp ... gdb compile failed, /gdbtest/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.cp/ambiguous.cc:70:36: warning: direct base 'A1' is inaccessible due to ambiguity: class JVA1 -> class KV -> class A1 class JVA1 -> class A1 [-Winaccessible-base] class JVA1 : public KV, public LV, public A1 { ^~~~~~~~~ 1 warning generated. This one's obviously intentional, gdb.cp/abmigiuous.exp contains "tests relating to ambiguous class members". But a lot of these cases aren't obvious, at least not to me. Is something a mistake? Some piece of K&R C from 1988 that was machine-converted in 1994? Or some real thing put there to stop GCC optimizing something out? I'm very much NOT someone to ask about code generation nuances! If something's obvious or (ha!) documented I can fix the source; places I've disabled warnings are where I couldn't tell what was intended/expected. Cheers, Gary