From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39347 invoked by alias); 22 Feb 2019 01:23:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39317 invoked by uid 89); 22 Feb 2019 01:23:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Feb 2019 01:23:54 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11EA9305D788; Fri, 22 Feb 2019 01:23:53 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7F9B19C5B; Fri, 22 Feb 2019 01:23:52 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x1M1Non4019179; Fri, 22 Feb 2019 02:23:50 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x1M1NmEC019178; Fri, 22 Feb 2019 02:23:48 +0100 Date: Fri, 22 Feb 2019 01:47:00 -0000 From: Jakub Jelinek To: Jonathan Wakely Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [committed] Fix -Wmissing-attributes warning in libstdc++ (PR libstdc++/89402) Message-ID: <20190222012348.GA7611@tucnak> Reply-To: Jakub Jelinek References: <20190220080731.GC2135@tucnak> <20190222011032.GA29002@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190222011032.GA29002@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg01802.txt.bz2 On Fri, Feb 22, 2019 at 01:10:32AM +0000, Jonathan Wakely wrote: > On 20/02/19 09:07 +0100, Jakub Jelinek wrote: > > Hi! > > > > The following patch fixes a warning when building on targets where long > > double switched from being the same as double to something wider, > > like e.g. powerpc*-linux, alpha*-linux, s390*-linux etc. > > > > Fixed thusly, bootstrapped/regtested on {x86_64,i686,s390x}-linux and > > bootstrapped on powerpc64le-linux, on both s390x and powerpc64le it removed > > all > > ../../../../libstdc++-v3/src/c++98/compatibility-ldbl.cc:77:17: warning: 'void _ZNKSt4hashIeEclEe()' specifies less restrictive attribute than its target 'std::size_t std::tr1::hash<_Tp>::operator()(_Tp) const [with _Tp = long double]': 'pure' [-Wmissing-attributes] > > warnings from the build log. Preapproved by Jonathan in the PR, committed > > to trunk. > > Now I see: > > /home/jwakely/src/gcc/libstdc++-v3/src/c++98/compatibility-ldbl.cc:78:65: warning: ‘pure’ attribute on function returning ‘void’ [-Wattributes] > 78 | _GLIBCXX_PURE __attribute__((alias ("_ZNKSt3tr14hashIeEclEe"))); > | ^ > > We can disable that with a diagnostic pragma. Oops, sorry, missed that. Or make it extern "C" size_t _ZNKSt4hashIeEclEe (long double) or so, after all, that is what it returns and what it takes as an argument. > > 2019-02-20 Jakub Jelinek > > > > PR libstdc++/89402 > > * src/c++98/compatibility-ldbl.cc (_ZNKSt4hashIeEclEe): Add > > _GLIBCXX_PURE to the alias declaration. > > > > --- libstdc++-v3/src/c++98/compatibility-ldbl.cc.jj 2019-01-01 12:39:41.530606161 +0100 > > +++ libstdc++-v3/src/c++98/compatibility-ldbl.cc 2019-02-19 16:12:52.402123217 +0100 > > @@ -75,6 +75,6 @@ namespace std _GLIBCXX_VISIBILITY(defaul > > // and std::hash::operator() > > // are the same, no need to duplicate them. > > extern "C" void _ZNKSt4hashIeEclEe (void) > > - __attribute__((alias ("_ZNKSt3tr14hashIeEclEe"))); > > + _GLIBCXX_PURE __attribute__((alias ("_ZNKSt3tr14hashIeEclEe"))); > > > > #endif Jakub