Andrea Pinski via Gcc [Thursday, 2 July 2026, 01:02:42 CEST]: > So GCC has always defaulted to -ftrapping-math but that has always > come with many issues. Especially if we go by Joseph's definition of > the flag (from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53805#c4 > and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54192):
At https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90993#c4 I was also calling for changing the default. I believe we should have a diagnostic on calls to the corresponding fenv functions when no-trapping-math is in effect. Sketch: https://compiler-explorer.com/z/rfM79fYGe Wrt. what the C++ standard says ... not much actually. At this point our working model in WG21/SG6 is that C++ hand-waves "there be floats". Implementations then implement ISO 60559 in addition to the C++ standard. 60559 specifies "attributes" that act on "blocks" which can affect this kind of behavior: - compiler flags implement these attributes - blocks are TUs. From my experience of the majority of floating-point code out there (casual uses rather than floating-point-expert magic), I very much believe that no- trapping-math is the correct default. -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──────────────────────────────────────────────────────────────────────────
