From patchwork Tue May 2 08:42:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 89284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp449341vqo; Tue, 2 May 2023 01:43:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41jfqGTPNPtXXShOgmxrssmVnH/Ge38YbmKkJQ7NlndjEZSBPR6OdAPL22prGLo6/sEsuo X-Received: by 2002:a05:6402:47:b0:504:a2e5:d951 with SMTP id f7-20020a056402004700b00504a2e5d951mr7926182edu.13.1683017026139; Tue, 02 May 2023 01:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683017026; cv=none; d=google.com; s=arc-20160816; b=g+LPEkWb3FsCvVtpaJXomTwjI/tS1+FP5NJi9DuSLyLxTMSvrg52z+pVKLBca66C22 p6smD0N40BLkqFJIHmMLUpLIgs+2ab67AtxjiMtV252Trf3ETzzFpOLGgS7oc5lmgkDQ pRQ8rXA1N1NfZnfmfxYTdJsmaO9dB74PPr7lBM4lvh3BJXGUfky0YpoolE+38wqm+Lde JRxIsJHs6GrNmhimvkYAXMd+GOU9wEnGd8VA/uj75uZgi9CUKSuw1eckUbzP3MHLEiUH PkdP0h73dZfdz0/p7qsbF/XJHYLHo8XqEonVewL/HzrCL4nTL7MqKtOze3e0GlFSGcQ/ Dsfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=GDrBFSCueO6v05HrsvAzivgNK+ibXpxTk03pW+KGFHk=; b=B53tUQmXjAcqm/dmi7ii2lk1M/sFMqLIaigcdfivhKmMeyEOHLGgZnLHFu8DWehb53 tb+IwgthCUW+6HM4YkUiKxFwFMC64USSQzx5/Bj0xcyH5hdDIauCtNhKaPWqJHT41u5g WF6V2yXOYG4cpvMP/heFMtHyXLLoYaKWBjSxXv67m7jrUrkEClSGfQb9W3Bg+OsYVIjw cTZ1VULym5FagciFALptUHTMwmPlHuTaRYLt4Tfg3YwQou+aybeLYMmYn/1Mb7FCBixV KOOa6IfpKA7adysrsPRSQ85tGyTH/oLKCRUR1pXZMxuktiAVt0wV8AEspV1afC6NVoa0 r65g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hjj6e+hn; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l1-20020aa7d941000000b0050bc8f33385si2220509eds.285.2023.05.02.01.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 01:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hjj6e+hn; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA8EF385772D for ; Tue, 2 May 2023 08:43:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA8EF385772D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683017014; bh=GDrBFSCueO6v05HrsvAzivgNK+ibXpxTk03pW+KGFHk=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=hjj6e+hnpOdCgzMTsTuh6FmiQTw+jI9Vr9T8nyOFeVDSSf8gQKCjvDacRhLZi7XYe 2/TuPtas930347P5UpyDzswdS9LuAAGVrFvW5tGqxYwqFrvnHMEQK7X7m/duZ11lBL IHYQGkcnPrwcraHC4+NvDEfyh7FqMnhTwePXiOis= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 C39463858D28 for ; Tue, 2 May 2023 08:42:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C39463858D28 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-435-ThDsYuIHNOyN3_ImTcMOlA-1; Tue, 02 May 2023 04:42:46 -0400 X-MC-Unique: ThDsYuIHNOyN3_ImTcMOlA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF3233806709; Tue, 2 May 2023 08:42:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 843211410F24; Tue, 2 May 2023 08:42:45 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3428ghr93120674 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 2 May 2023 10:42:43 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3428gg663120671; Tue, 2 May 2023 10:42:42 +0200 Date: Tue, 2 May 2023 10:42:42 +0200 To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Shut up -Wattribute-alias warning [PR109694] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.8 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764771261243527270?= X-GMAIL-MSGID: =?utf-8?q?1764771261243527270?= 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: ‘void std::ios_base_library_init()’ alias between functions of incompatible types ‘void()’ and ‘void (std::ios_base::Init::)()’ [-Wattribute-alias=] 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? 2023-05-02 Jakub Jelinek PR libstdc++/109694 * src/c++98/ios_init.cc: Add #pragma GCC diagnostic ignored for -Wattribute-alias. Jakub --- 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 +0200 @@ -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