Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0yfl-002Nh6-0j for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 09:19:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0yfi-002m1c-2K for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 09:19:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0yfi-002m1T-0z for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 09:19:06 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0yfg-00000001ulQ-1Mev for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 09:19:05 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-485409ab264so13730675e9.1 for ; Fri, 13 Mar 2026 02:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773393541; x=1773998341; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CIIgw9+s5nKPGTM1ks9QT8+MO3UJBLId3TL3MUaE8so=; b=XfaRDks75kaYwgmILyj0AA8G9ViOeYAOZPHwVllY2Yc2ALgWggjHlGMop939D/BQCc AcurrX5bVCmYuB3tnk0YuezyZPxVUbpvnAzcvyJqS/w/ZSLqsBgSvc7g3chrvaULDzkD iMGXIFU+zLD2oLdufd+mnX2KWLWrNSznsMaqNGaaDHgY9AJF+faTHolLlEuBRVO3r/sW 7nXjpbXotYqzdCSwz+1o7skebo/aEI9ii93IjSNHmLWXGNhhsnJMHZdM/w9VNd6TnYEJ UFivfa0bO3gMldMltYD2Souti9egDh17Li2cA3p/ijNZrqlDqvUbdUoswYvkEn0gIkPl ogOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773393541; x=1773998341; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CIIgw9+s5nKPGTM1ks9QT8+MO3UJBLId3TL3MUaE8so=; b=G3L+ut4AM/mIVBo+A3bslqCiJVsr7CYXv46KVQZD+zpmCVj1zqKplWxyJUBta3sozr ozIPWUm+3NdCTtpBXmlaQQg6h1LyV3j3ZurnvWtP7T55J5tYXD8Z/CCRZ+z90uZmbCVf IGvXiWt1ei0+F8itSQ6J+zwcqxPjrfL1Ug4ZVQmXz9dXPVxmUdGcXOguttG9IVSc4CZ1 CtWaq9ZJt8EtDpZ1IHSrtu2jySfQmEklMBtrxRJ7xTs0r81cQPPiJYxoMT22LgGWhrk1 8DAuWOLw272tyAG377smjs95jqlY29t1XgEe4QQ3hv4jy0u+4cZPDI9fMkHGODJ6ducr dEMQ== X-Forwarded-Encrypted: i=1; AJvYcCW+/bz5nwPaCTMaXAzZn1KFII5Ajggrdsr3YiytNpHdysIyl6BPAW7pUB5bb+zHWErtzcVcsdYJZbYapoST@lists.postgresql.org X-Gm-Message-State: AOJu0Yzfc8KpFr8K/9W6jrvsgPO5vDN2EoW2AmFSPy2+ewky/N68xY1H iNeAzPmEV5i/N5dlI2ywZ1C6kXxlU5pmypDWQ6UQORBiDhYkXujvP90b X-Gm-Gg: ATEYQzwqSsr3C/i0ds3J6RYaZSB41bOEBXqPONCMrAaq6L4Z4IU7xnTheq7YG3jIxq8 hKs+OpfKjpb9Lx44VpWIRKnvWSbvoU/IHpnkISC8SuwJLaQPjI9Yil9LW5n9PFBvdwS04P1qKYV n/TPvSVDQfP30N8HEcS9T2r6sXsgHWZYjp9TuCeUv/dqCzpt0u9Hjp96K0++njCRuyvyU4rlRtF 7WctcgFjIhNoZFcIgTr2pZWqG4EQGcPjdrlKfTtyROoJe5rssiOBgoQJhRVc1fntNs+b7c2HyFX Y8fmIuPcIb0tR3y/8qTeMn7We9O//HbF2UXwWFagi2YPHm1QlJK+v1JYZ5JtMP+v0cEqyduhMhP TUkZ10O0+oKBLmcnprbJualzDCwvKG6UPd0Vpy+lnkwfJuAxcVqyqD8erU9SM2eawRUFfNLjrDD iA9Nmx1m9cuNV0RXtYBfBFjoedPVxAHICXvP+kjK7/FtX46BkkYxEpkn0craS3eG+JFXQ6BasnP FwMo0Sr9f+iGqYsfR60frZyQWFH2ksk0cgMOAyd/Tr9OVBogh9yyU8tmA== X-Received: by 2002:a05:600c:1907:b0:485:50ac:b8cf with SMTP id 5b1f17b1804b1-48555a5689amr40338685e9.0.1773393541053; Fri, 13 Mar 2026 02:19:01 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48541b6f6e6sm522555125e9.10.2026.03.13.02.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 02:19:00 -0700 (PDT) Date: Fri, 13 Mar 2026 09:18:59 +0000 From: Bertrand Drouvot To: Tom Lane Cc: Andres Freund , Peter Eisentraut , pgsql-hackers@lists.postgresql.org Subject: Re: Defend against -ffast-math in meson builds Message-ID: References: <3316.1773242385@sss.pgh.pa.us> <3583.1773247555@sss.pgh.pa.us> <4425.1773328251@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LlTAxJ2fZwYEH6fs" Content-Disposition: inline In-Reply-To: <4425.1773328251@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LlTAxJ2fZwYEH6fs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Thu, Mar 12, 2026 at 11:10:51AM -0400, Tom Lane wrote: > Bertrand Drouvot 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. Yeah, I do agree. Something like in the attached? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --LlTAxJ2fZwYEH6fs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Move-ffast-math-defense-to-float.c-and-remove-the.patch"