From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106709 invoked by alias); 8 Sep 2017 15:25:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 105573 invoked by uid 89); 8 Sep 2017 15:25:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,URIBL_RED autolearn=no version=3.3.2 spammy=H*F:D*br X-HELO: mo20.mail-out.ovh.net Date: Fri, 08 Sep 2017 15:25:00 -0000 From: "Gabriel F. T. Gomes" To: Joseph Myers CC: Subject: Re: [PATCH 2/3] powerpc: Add redirection for finitef128, isinf128, and isnanf128 Message-ID: <20170908122540.4ee0fffb@keller> In-Reply-To: References: <20170907104352.7748-1-gabriel@inconstante.eti.br> <20170907104352.7748-3-gabriel@inconstante.eti.br> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX2.emp.local (172.16.2.2) To EX2.emp.local (172.16.2.2) X-Ovh-Tracer-Id: 13150510913213157101 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrfeeggdeltdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-SW-Source: 2017-09/txt/msg00381.txt.bz2 On Thu, 7 Sep 2017 14:39:42 +0000 Joseph Myers wrote: >On Thu, 7 Sep 2017, Gabriel F. T. Gomes wrote: > >> This patch defines __finitef128 as __redirect___finitef128 in >> sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c, similarly to what's >> done for the float, double, and long double versions of these functions, >> to get rid of the build error. Likewise for isinff128 and isnanf128.=20= =20 > >What is the build error? Why should s_finite.c need to redirect=20 >__finitef128, or to redirect __finitef or __finitel for that matter?=20=20 >s_finitef.c manages to redirect only __finitef, not any of the other=20 >versions, after all. I'm sorry for not making this clear in the patch itself. I'll try to explain what was my rationale and if that sounds OK, I'll add that to the commit message and comments. This is the build error: In file included from :0:0: ../include/math.h:29:15: error: =E2=80=98__finitef128=E2=80=99 undeclared h= ere (not in a function); did you mean =E2=80=98__rintf128=E2=80=99? hidden_proto (__finitef128) ^~~~~~~~~~~~ ./../include/libc-symbols.h:518:27: note: in definition of macro =E2=80=98_= _hidden_proto=E2=80=99 extern thread __typeof (name) name __hidden_proto_hiddenattr (attrs); ^~~~ ../include/math.h:29:1: note: in expansion of macro =E2=80=98hidden_proto= =E2=80=99 hidden_proto (__finitef128) ^~~~~~~~~~~~ The output of the preprocessor has the following lines (snippets): # 21 "../math/bits/mathcalls-helper-functions.h" [...] extern int __redirect___finite (double __value) __attribute__ ((__nothrow__= )) __attribute__ ((__const__)); [...] extern int __redirect___finitef (float __value) __attribute__ ((__nothrow__= )) __attribute__ ((__const__)); [...] extern int __redirect___finitel (long double __value) __attribute__ ((__not= hrow__ )) __attribute__ ((__const__)); [...] extern int __redirect___finitef128 (_Float128 __value) __attribute__ ((__no= throw__ )) __attribute__ ((__const__)); (from the multiple inclusions of mathcalls-helper-functions.h (see comment about the differences between s_finite.c and s_finitef.c further down this message)) But include/math.h declares hidden prototypes for them (snippet): # 9 "../include/math.h" 2 [...] extern __typeof (__redirect___finite) __redirect___finite __attribute__ ((v= isibility ("hidden"))); [...] extern __typeof (__redirect___finitef) __redirect___finitef __attribute__ (= (visibility ("hidden"))); [...] extern __typeof (__redirect___finitel) __redirect___finitel __attribute__ (= (visibility ("hidden"))); [...] extern __typeof (__finitef128) __finitef128 __attribute__ ((visibility ("hi= dden"))); ~~~~~~~~~~~ Here's the source of the error. As for the difference between s_finite.c and s_finitef.c, that happens because include/math.h includes math/math.h before creating the hidden prototypes. On top of that, math/math.h includes bits/mathcalls-helper-functions.h (once for each floating-point type). However, the declarations in bits/mathcalls-helper-functions.h are macroized using __MATHDECL_1. __MATHDECL_1 receives the suffix (f, l, f128, or nothing) as a parameter and expands the base name (e.g.: __finite). When s_finite.c defines __finite as __redirect_finite, all declarations in bits/mathcalls-helper-functions.h are also redefined. That doesn't happen with s_finitef.c because it only defines __finitef, which does not match with anything in bits/mathcalls-helper-functions.h.