Re: Defend against -ffast-math in meson builds

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Defend against -ffast-math in meson builds
Date: 2026-03-12 15:10:51
Message-ID: 4425.1773328251@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> writes:
> On Wed, Mar 11, 2026 at 01:48:31PM -0400, Andres Freund wrote:
>> 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".

Yeah, that was my thought too. But I think Andres has a point that in
principle an extension could use -ffast-math intentionally, so I'm
content to just put the test in float.c.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yura Sokolov 2026-03-12 15:20:17 Re: Drop 32-bit support (was "Re: Fix typo 586/686 in atomics/arch-x86.h")
Previous Message Tom Lane 2026-03-12 15:07:25 Re: Areas for Solaris support modernization