This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH] Remove __isinf uses that rely on signed return value
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: "'Joseph Myers'" <joseph at codesourcery dot com>
- Cc: "GNU C Library" <libc-alpha at sourceware dot org>
- Date: Wed, 3 Jun 2015 12:35:58 +0100
- Subject: RE: [PATCH] Remove __isinf uses that rely on signed return value
- Authentication-results: sourceware.org; auth=none
- References: <001301d09d57$c0bfdf60$423f9e20$ at com> <alpine dot DEB dot 2 dot 10 dot 1506021739210 dot 21592 at digraph dot polyomino dot org dot uk>
> Joseph Myers wrote:
> On Tue, 2 Jun 2015, Wilco Dijkstra wrote:
>
> > The printf code contains a few uses of __isinf where the sign is used -
> > replace these with separate isinf and signbit.
>
> Why? Isn't the point of glibc's isinf returning a signed value that you
> can do such combined operations?
We discussed this a while back (and I thought it was agreed on going forward
like this) - to recap, it is not required by any standard (so no standard
compliant software may rely on this GLIBC specific behaviour), and is
actually incompatible with C++ which requires a boolean to be returned.
So the idea is to only support the old behaviour in GNUC mode for backwards
compatibility, but not in C99/C++.
It would be possible to introduce a new macro isinf_sign if someone can make
the argument it is a good interface. I don't see how it could be as getting
the sign is just a single compare or shift once you've transferred the FP
value to the integer side - in other words isinf_sign (x) will be slower than
using isinf (x) plus signbit (x)...
> I'd also really recommend separating safe cleanups that don't change the
> stripped installed shared libraries at all (other than assertion line
> numbers), such as moving to use the type-generic macros internally, from
> any other changes that might affect the installed binaries. And when
> something shouldn't change the (stripped) installed binaries, verify that
> it doesn't, and state the platform on which you did such verification.
I have a separate patch with all the __isxxx macros renamed across GLIBC, so
I'll add the __isnan cases in printf too. I'll check in when I've confirmed
there are no diffs.
Wilco