From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BBC83385701F for ; Sat, 22 Aug 2020 14:54:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BBC83385701F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 6B3C51E599; Sat, 22 Aug 2020 10:54:14 -0400 (EDT) Subject: Re: [PATCH] gdb/testsuite: ISO C++17 does not allow register storage class specifier. To: Mark Wielaard , gdb-patches@sourceware.org References: <20200822121935.6086-1-mark@klomp.org> From: Simon Marchi Message-ID: Date: Sat, 22 Aug 2020 10:54:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200822121935.6086-1-mark@klomp.org> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, 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: Sat, 22 Aug 2020 14:54:16 -0000 On 2020-08-22 8:19 a.m., Mark Wielaard wrote: > g++ enables -Wregister when defaulting to C++17. Disable it for those > tests that explicitly use register. > > gdb/testsuite/ChangeLog: > > * gdb.cp/classes.exp (prepare_for_testing): Add > additional_flags=-Wno-register. > * gdb.cp/inherit.exp (prepare_for_testing): Likewise. > * gdb.cp/misc.exp (prepare_for_testing): Likewise. > --- > gdb/testsuite/ChangeLog | 7 +++++++ > gdb/testsuite/gdb.cp/classes.exp | 2 +- > gdb/testsuite/gdb.cp/inherit.exp | 2 +- > gdb/testsuite/gdb.cp/misc.exp | 2 +- > 4 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog > index 7976dd76306..c55c9a71415 100644 > --- a/gdb/testsuite/ChangeLog > +++ b/gdb/testsuite/ChangeLog > @@ -1,3 +1,10 @@ > +2020-08-22 Mark Wielaard > + > + * gdb.cp/classes.exp (prepare_for_testing): Add > + additional_flags=-Wno-register. > + * gdb.cp/inherit.exp (prepare_for_testing): Likewise. > + * gdb.cp/misc.exp (prepare_for_testing): Likewise. > + > 2020-08-20 Tankut Baris Aktemur > > * gdb.base/print-file-var.exp: Fix typo "breapoint". > diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp > index 4a2287a8704..89e64c47cf9 100644 > --- a/gdb/testsuite/gdb.cp/classes.exp > +++ b/gdb/testsuite/gdb.cp/classes.exp > @@ -25,7 +25,7 @@ load_lib "cp-support.exp" > standard_testfile .cc > > if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ > - {debug c++ additional_flags=-Wno-deprecated-register}]} { > + {debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} { > return -1 > } The register keyword in this test is used here: 629 /* We don't call any methods for v, so gcc version cygnus-2.3.3-930220 630 might put this variable in a register. This is a lose, though, because 631 it means that GDB can't call any methods for that variable. */ 632 register small v; Can we first check if we can simply remove the register keyword from the test? I don't understand the comment above: do we want v to be in a register or not? It sounds like we don't, we want it to be in memory so we can call a method on it, from GDB. So why use the register keyword? > > diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp > index 2d4635c96ad..677d9ee5476 100644 > --- a/gdb/testsuite/gdb.cp/inherit.exp > +++ b/gdb/testsuite/gdb.cp/inherit.exp > @@ -27,7 +27,7 @@ load_lib "cp-support.exp" > standard_testfile misc.cc > > if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ > - {debug c++ additional_flags=-Wno-deprecated-register}]} { > + {debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} { > return -1 > } > > diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp > index 61034bf8088..94acbd0b493 100644 > --- a/gdb/testsuite/gdb.cp/misc.exp > +++ b/gdb/testsuite/gdb.cp/misc.exp > @@ -20,7 +20,7 @@ if { [skip_cplus_tests] } { continue } > standard_testfile .cc > > if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ > - {debug c++ additional_flags=-Wno-deprecated-register}]} { > + {debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} { > return -1 > } These last two tests use misc.cc, from which classes.cc was copied. So can we first check if it would make sense to just drop the register keyword? Simon