[PATCH] various fixes detected with -Wdouble-promotion

Alexander Monakov amonakov@ispras.ru
Sat Oct 11 09:47:16 GMT 2025


On Sat, 11 Oct 2025, Paul Eggert wrote:

> On 2025-10-11 00:16, Paul Zimmermann wrote:
> > -      else if (x == 0.0)
> > +      else if (x == 0.0f)
> 
> Changes like this make the code a bit harder to read and to maintain, and they
> don't add an iota of reliability.

Would you say the same about changing to 'x == 0' (integer zero)?

> It'd be better to ignore or disable -Wdouble-promotion, which is typically a
> waste of everybody's time.

That's how it is today, it's not enabled by default. But as changes like this:

-    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. So I would support the patch, and if changing 0.0 to 0.0f
is not desirable, I can suggest using integer constants where applicable.

(also, let me tell you: I found the tone of your message incredibly off-putting,
I was hoping Glibc was moving past that)

Alexander


More information about the Libc-alpha mailing list