[PATCH] various fixes detected with -Wdouble-promotion
Paul Zimmermann
Paul.Zimmermann@inria.fr
Tue Oct 14 07:57:58 GMT 2025
thank you Paul, I'll submit a v2.
Paul Z.
> Date: Mon, 13 Oct 2025 13:43:04 -0700
> Cc: GNU C Library <libc-alpha@sourceware.org>
> From: Paul Eggert <eggert@cs.ucla.edu>
> Organization: UCLA Computer Science Department
>
> On 2025-10-13 11:43, Wilco Dijkstra wrote:
> >>> - p6 = p[6] + y * -0xf.ff6b8p-12;
> >>> + p6 = p[6] + y * -0xf.ff6b8p-12f;
> >>>
> >>> in the patch show, Glibc would be better off being clean w.r.t
> >>> -Wdouble-promotion.
> >> no worry, I saw no offense. It is good that we can have different opinions on
> >> this list. Personally I wish I had known -Wdouble-promotion before, since this
> >> would have saved several times me some time to find why my code was so slow.
> > We've tried hard to keep the math code type clean, so almost all float constants use
> > the 'f' suffix correctly.
>
> Thanks. For the particular example quoted above, it'd be helpful to add
> a comment saying that using float rather than double does not affect the
> result (even though a naive reading would make it seem so). Or if this
> sort of thing is common in the file, a blanket comment at the start
> saying something like "This file uses 'float' computations exclusively;
> we've tested, and using 'double' does not increase accuracy." Or
> something like that.
>
>
More information about the Libc-alpha
mailing list