From f3d3affa9662dd42c1cf9b97ba09e6476f9b1652 Mon Sep 17 00:00:00 2001 From: Sirac Ozmen Date: Thu, 5 Nov 2026 17:53:15 +0300 Subject: [PATCH] fix(maul): keep Clang's trapping math off in the family's float flags --- maul/files/cmake/CompilerFlags.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maul/files/cmake/CompilerFlags.cmake b/maul/files/cmake/CompilerFlags.cmake index 38d15cb..36b497c 100644 --- a/maul/files/cmake/CompilerFlags.cmake +++ b/maul/files/cmake/CompilerFlags.cmake @@ -57,9 +57,15 @@ function(maul_apply_flags target) # target, never a C library call (on 32-bit x86, an x87 one). It # comes after -fno-fast-math, which in GCC turns errno math back on. # Trapping math is left at each compiler's default (on in GCC, off - # in Clang): GCC's -fno-fast-math turns it back on anyway. + # in Clang): GCC's -fno-fast-math turns it back on anyway. So the + # unsafe optimizations are turned off one by one, not through + # -fno-unsafe-math-optimizations, which in Clang also turns trapping + # math on: strict floating-point exceptions, which Clang refuses on + # 32-bit ARM and which no Maul library reads. GCC's options come + # out the same either way. target_compile_options(${target} PRIVATE - -ffp-contract=off -fno-fast-math -fno-unsafe-math-optimizations -fno-math-errno + -ffp-contract=off -fno-fast-math -fno-associative-math -fno-reciprocal-math + -fsigned-zeros -fno-math-errno -Wall -Wextra -Wshadow -Wdouble-promotion -Wfloat-conversion $<$:-Wmissing-prototypes>) # A 64-bit value cut to 32 bits, where pointers are 64 bits (a