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.129.124]) by sourceware.org (Postfix) with ESMTPS id 6B59C3857024 for ; Wed, 26 Oct 2022 12:02:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B59C3857024 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666785757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0OVOlGcbwKv5qxJwOtUKEgtuAmZa87K/slj7Wu4GPU0=; b=O4aT4qtiCxyeXibYJLGMW1K17lgsoRhsaTAFgIvJd2PKQVyJDcdVpWlHNj4JF4CA72JLox FKLtFkvwZLTzwW1it/M+F2YavikhqeLkPf/AiiXOc9j4k+HfWNR0mBd1DRUhug5JbFbeB+ +0SdtLo4QKViJImihRVYTXfT8U+FXnM= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-645-YcDlwNd1NWidR5Omzr46mw-1; Wed, 26 Oct 2022 08:02:35 -0400 X-MC-Unique: YcDlwNd1NWidR5Omzr46mw-1 Received: by mail-wr1-f71.google.com with SMTP id u13-20020adfa18d000000b00236566b5b40so5554185wru.9 for ; Wed, 26 Oct 2022 05:02:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0OVOlGcbwKv5qxJwOtUKEgtuAmZa87K/slj7Wu4GPU0=; b=SfNbbG+IxssrqqVaIPgnXBvIy8g59IB6YUKYcyt4L+Zwcwwkl5uh6KI7TlYUZ5FJE4 08edbuwLm+0fJP/NkNIMT62n/k+OJRim3sOhc9vDgsLHVyK0sg/0sTNp3zP/c0vPeuqh e2PKuRvqe4pax3ebNJvgZ6oGWd5/doGmy9h1GQY8WQDbY0t7gwr1+jiGHZWmyC7Gs46+ VuSZpdZxdJLdMYWdeQ0df4aZ4RwDGx0iYRSSDWksLT2a37By3XhI0MailyWgkGcd8V3m cjBVt2H50DPWYJCPG12209LOcjkn9LZoQPUVrWimI2TJC1q0XQl6DYv4x8MXje87gY6T mHQQ== X-Gm-Message-State: ACrzQf1ro4EbS2Z55UOFo1+V8QuKeC+IlMyT8T6tFbLzLp+7T8Gqm2sb NyZS3YwBONVqcfSQPWpkJ9FHaZYYN4NTJakce+I8VsBjw7wYK1VG45mdVu5G+btWkqGNaVFGVOp eLe5Q9MyKsOdTk85vcOnNnw== X-Received: by 2002:a5d:584d:0:b0:230:c250:603e with SMTP id i13-20020a5d584d000000b00230c250603emr28012271wrf.143.1666785754661; Wed, 26 Oct 2022 05:02:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xG7vksM83TZ5RYravRxPY/4P8TfhuuJr9IoyLOMXcmPTySKfM6GJRocHNwwJiczSYi2OdQw== X-Received: by 2002:a5d:584d:0:b0:230:c250:603e with SMTP id i13-20020a5d584d000000b00230c250603emr28012224wrf.143.1666785754178; Wed, 26 Oct 2022 05:02:34 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b003c7087f6ca8sm1895588wms.2.2022.10.26.05.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 05:02:33 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH 01/11] gdb/testsuite: ignore Non-C-typedefs for gdb.cp/class2.exp In-Reply-To: <20221004170747.154307-2-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> <20221004170747.154307-2-blarsen@redhat.com> Date: Wed, 26 Oct 2022 13:02:32 +0100 Message-ID: <87h6zq7pyf.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bruno Larsen via Gdb-patches writes: > When attempting to test gdb.cp/class2.exp using clang, it fails to > prepare with the following error: > > Executing on host: clang++ -fdiagnostics-color=never -Wno-unknown-warning-option -c -g -o /home/blarsen/Documents/fsf_build/gdb/testsuite/outputs/gdb.cp/class2/class20.o /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc (timeout = 300) > builtin_spawn -ignore SIGHUP clang++ -fdiagnostics-color=never -Wno-unknown-warning-option -c -g -o /home/blarsen/Documents/fsf_build/gdb/testsuite/outputs/gdb.cp/class2/class20.o /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc > /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:53:14: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] > typedef class { > ^ > Dbase > /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:54:2: note: type is not C-compatible due to this member declaration > public: > ^~~~~~~ > /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:58:3: note: type is given name 'Dbase' for linkage purposes by this typedef declaration > } Dbase; > ^ > 1 warning generated. > gdb compile failed, /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:53:14: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] > typedef class { > ^ > Dbase > /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:54:2: note: type is not C-compatible due to this member declaration > public: > ^~~~~~~ > /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:58:3: note: type is given name 'Dbase' for linkage purposes by this typedef declaration > } Dbase; > ^ > 1 warning generated. > UNTESTED: gdb.cp/class2.exp: failed to prepare > > This can be silenced by adding -Wno-non-c-typedef-for-linkage. The test > shows no failures with this change. > --- > gdb/testsuite/gdb.cp/class2.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp > index 32f9dfc18a5..e1e4ad0fae6 100644 > --- a/gdb/testsuite/gdb.cp/class2.exp > +++ b/gdb/testsuite/gdb.cp/class2.exp > @@ -18,7 +18,7 @@ if { [skip_cplus_tests] } { return } > > standard_testfile .cc > > -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { > +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++ additional_flags=-Wno-non-c-typedef-for-linkage}]} { > return -1 I worry about just adding an extra flag like this. GCC is happy enough as it ignores unknown arguments, but some other compiler might be unhappy. Additionally, with earlier versions of clang++ (I tested 9.0.1) the new flag isn't recognised, and actually causes the build to fail. I wonder if we should look to something like gdb.cp/pr9167.exp for how to solve this? In that script we do this: set flags [list debug c++] if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } { # Work around PR gcc/101452. lappend flags additional_flags=-fno-eliminate-unused-debug-types } this might be a better model for how to add the flag. Thanks, Andrew