This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 7/9] Refactor math-finite.h and introduce mathcalls-redir.h
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>, <gabriel at inconstante dot eti dot br>, <raji at linux dot ibm dot com>
- Date: Wed, 6 Jun 2018 23:23:22 +0000
- Subject: Re: [PATCH 7/9] Refactor math-finite.h and introduce mathcalls-redir.h
- References: <20180606223909.16675-1-tuliom@linux.ibm.com> <20180606223909.16675-8-tuliom@linux.ibm.com>
On Wed, 6 Jun 2018, Tulio Magno Quites Machado Filho wrote:
> On a new enough compiler, redirecting the same function twice can cause
> -Werror=pragmas errors. This issue may appear when redirecting an ISO C
> floating point function to a different ABI at the same time that finite
> redirections are expected.
Does this issue already appear with -mlong-double-64? If so, it should
definitely be separated out from this patch series and have a bug filed in
Bugzilla as usual for anything fixing a bug that was user-visible in a
release.
The approach taken in this patch involves a lot of duplication of both
function prototypes and the feature-test-macro conditions on when those
functions are declared (duplicating them for functions not included in
math-finite.h, when previously only those in math-finite.h had such
duplication). Such duplication is, from experience, fragile and a bad
idea; the conditions and declarations are too likely to get out of sync.
Instead, I'd suggest merging bits/math-finite.h into bits/mathcalls.h as
much as possible - have macros such as __MATHCALL_FINITE that are called
in bits/mathcalls.h to declare the functions with __*_finite variants, and
with __MATHCALL_FINITE defined the same as __MATHCALL when the finite
function variants aren't in use. That way you have just a single
redirection for each function. (You'll need a sysdeps bits/ header for an
architecture, i.e. ia64, to declare it doesn't support the _finite
functions at all.)
--
Joseph S. Myers
joseph@codesourcery.com