Re: Defend against -ffast-math in meson builds - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Defend against -ffast-math in meson builds
Date
Msg-id abKU4cLSlRu6v3J+@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Defend against -ffast-math in meson builds  (Andres Freund <andres@anarazel.de>)
Responses Re: Defend against -ffast-math in meson builds
List pgsql-hackers
Hi,

On Wed, Mar 11, 2026 at 01:48:31PM -0400, Andres Freund wrote:
> Hi,
> 
> On 2026-03-11 12:45:55 -0400, Tom Lane wrote:
> > So no, I don't wanna support this.  But maybe we should move the
> > code-level tests out of the datetime files and into utils/float.h
> > or some such place.
> 
> I think it's probably better to have it in a .c file (maybe float.c), I could
> kinda imagine some extension intentionally enabling -ffast-math, because it
> does something numerically intensive where the incorrectness doesn't matter.

I think that you have a good point about the extension. That said a .h file
could also prevent the extension to make use of -ffast-math "accidentally".

And if they really want it, I think that they could compile the extension with
"-ffast-math -U__FAST_MATH__" to make it work. I just tested it and that works
but now that I write it that looks like an odd combination, so a .c file looks
better.

What do you think?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Viktor Holmberg
Date:
Subject: Re: support fast default for domain with constraints
Next
From: Pavel Stehule
Date:
Subject: Re: POC: PLpgSQL FOREACH IN JSON ARRAY