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 E74503858D1E for ; Tue, 2 May 2023 08:49:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E74503858D1E 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=1683017357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TjcR7Gk6UPjqMp1hC5Gx8HJtAk9oYTnoiMy5GZrSjXc=; b=LybWdLfYk3QMj8mKyGv2PqOrUQ4AhY9KsSYXbmZa0QFYuW4gmhwFxDjMvFG60W1m4UKPNl Qohxmt6JSVkIN06gCRHjRW1IBkh7eXzhWHzcsYmdP+MHjMLiPYuWv51kqKgv2JQwaP7JIM nyCMKETE7csZqCrEZYq9bSBos0cwQ/w= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-Rz0YK6JDN5umF6HcFCWh3w-1; Tue, 02 May 2023 04:48:51 -0400 X-MC-Unique: Rz0YK6JDN5umF6HcFCWh3w-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2a7e3466cbfso16357641fa.3 for ; Tue, 02 May 2023 01:48:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683017330; x=1685609330; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TjcR7Gk6UPjqMp1hC5Gx8HJtAk9oYTnoiMy5GZrSjXc=; b=fylzCvLdmAvGJiWMJggMJQnsMY2V6BV0sm15eNRx+S2uIdzbY6EuUUe5dekR8fRed5 4ofVZHhFtxYEM1ZN1atuPHZob+f8c7cl/zGoap3OQXm5Vz6lUF+r85Uu8FmI10yTkTKn ReAnZ5kSaXCDeEcH9K7BPW6x3rfG6Dl5oedDI0U/PhiR2x9Pq4rsaAuZhkuKJv+5i8Qt bLwchP/lxkm8Id2fr1PsMYQJdktDNxyQi8byb2jPoFqbRFW97Ad+Co4u/HgVod707YDs Mpp9YUmlTBw+6c/ht0WIXg2lXyeEBRon1P3i9QeIKCsVCz1xpqUisjbgJvM0gAJMLiUc Npsg== X-Gm-Message-State: AC+VfDz5+8C+pfhny8E8uB0DDrmutnLV9Na+SDSlfAsNTD/9tTYMjHQB Nb3nLTQjM8hJgHi80EtjdvNWzLHZre94KHcbnKFPIv4porwTTngvjgPmbBce/V/mec9AR3zhU2t 4kkDwTCTf+4PCAdxYj1B9jtmBRzkMbt6cDg== X-Received: by 2002:a2e:b606:0:b0:2ab:4436:cbc0 with SMTP id r6-20020a2eb606000000b002ab4436cbc0mr3873136ljn.37.1683017330320; Tue, 02 May 2023 01:48:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jB/KMFPbCeBm8Ss3BCidwLtnZcbS9+Qzt/e6oZYhKmR7Kaftoe5kusPlskppNuy8UkuWRj1MAI7FX/9YFe9c= X-Received: by 2002:a2e:b606:0:b0:2ab:4436:cbc0 with SMTP id r6-20020a2eb606000000b002ab4436cbc0mr3873132ljn.37.1683017330019; Tue, 02 May 2023 01:48:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 2 May 2023 09:48:38 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Shut up -Wattribute-alias warning [PR109694] To: Jakub Jelinek Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000001b6add05fab202fe" X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: --0000000000001b6add05fab202fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2 May 2023 at 09:42, Jakub Jelinek wrote: > Hi! > > I've followed what other files do, using attribute alias with not really > matching function type (after all, it isn't really possible when it is a > constructor), but seems I've missed it warns: > ../../../../../libstdc++-v3/src/c++98/ios_init.cc:203:8: warning: =E2=80= =98void > std::ios_base_library_init()=E2=80=99 alias between functions of incompat= ible types > =E2=80=98void()=E2=80=99 and =E2=80=98void (std::ios_base::Init::)()=E2= =80=99 [-Wattribute-alias=3D] > 203 | void ios_base_library_init (void) > | ^~~~~~~~~~~~~~~~~~~~~ > ../../../../../libstdc++-v3/src/c++98/ios_init.cc:78:3: note: aliased > declaration here > 78 | ios_base::Init::Init() > | ^~~~~~~~ > The PR talks about clang++ warning there (which I think isn't really > supported, libstdc++ sources ought to be built by GCC), but it warns > when built with GCC too. > > The following patch fixes it by doing what other libstdc++ sources do in > those cases. > > Tested on x86_64-linux, ok for trunk and later 13.2? > OK, thanks. > > 2023-05-02 Jakub Jelinek > > PR libstdc++/109694 > * src/c++98/ios_init.cc: Add #pragma GCC diagnostic ignored for > -Wattribute-alias. > > --- libstdc++-v3/src/c++98/ios_init.cc.jj 2023-04-28 > 10:49:22.105352644 +0200 > +++ libstdc++-v3/src/c++98/ios_init.cc 2023-05-02 10:24:09.073741162 +02= 00 > @@ -200,6 +200,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > } > > #ifdef _GLIBCXX_SYMVER_GNU > +#pragma GCC diagnostic ignored "-Wattribute-alias" > + > void ios_base_library_init (void) > __attribute__((alias ("_ZNSt8ios_base4InitC1Ev"))); > #endif > > Jakub > > --0000000000001b6add05fab202fe--