From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 703A73857034; Thu, 4 May 2023 07:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 703A73857034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683186276; bh=x8Ry0IqolAbs1Bcf6JRZU/iMQvVtVdSMuMjbiaQpMJU=; h=From:To:Subject:Date:From; b=IkMsf/fYEmJUdeCb3ZxS3BBzQosz0J3r1V2fn9FkRW1/c0GWqMywT0VUKkEWZO2j7 r4HFAtXgkeD3vCYGyE2Z53VJMmtQ5Hlhm1vFN7e7aZO4OiQM+Mml8pM93aSHCpD4bC ZG1hIan6SPEGSGxo4p770A1s0UPOOX4bw5q3CMAw= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-7288] ibstdc++: Shut up -Wattribute-alias warning [PR109694] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: 9c9061e0418ded473672069aac43b25f6fd491b8 X-Git-Newrev: addbe91570d7da35c48e6cf35b002a94a699fdd0 Message-Id: <20230504074436.703A73857034@sourceware.org> Date: Thu, 4 May 2023 07:44:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:addbe91570d7da35c48e6cf35b002a94a699fdd0 commit r13-7288-gaddbe91570d7da35c48e6cf35b002a94a699fdd0 Author: Jakub Jelinek Date: Tue May 2 10:58:19 2023 +0200 ibstdc++: Shut up -Wattribute-alias warning [PR109694] 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. 2023-05-02 Jakub Jelinek PR libstdc++/109694 * src/c++98/ios_init.cc: Add #pragma GCC diagnostic ignored for -Wattribute-alias. (cherry picked from commit 87de39e4c3686535728f3a347f772e73af4cf262) Diff: --- libstdc++-v3/src/c++98/ios_init.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/src/c++98/ios_init.cc b/libstdc++-v3/src/c++98/ios_init.cc index 0c2ba945f36..ace94b992b5 100644 --- a/libstdc++-v3/src/c++98/ios_init.cc +++ b/libstdc++-v3/src/c++98/ios_init.cc @@ -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