[RFC] math/powl: Workaround clang build

Alexander Monakov amonakov@ispras.ru
Wed Dec 11 06:22:36 GMT 2024


On Wed, 11 Dec 2024, YunQiang Su wrote:

> In condtional operator, only one operand of the result operands is allowed
> to be evaluated, while in some cases clang has a bug on it.
> So in some cases both underflow and overflow exceptions are raised.

Unlike GCC, Clang implements the STDC FENV_ACCESS pragma with default state
'off'. When using Clang for building Glibc, you have to pass -ftrapping-math
to the compiler to ensure floating-point exceptions are honored.

Probably best to add -ftrapping-math along with -frounding-math to math-flags
in Makeconfig. This will also help if any future GCC switches to
-fno-trapping-math by default.

Alexander


More information about the Libc-alpha mailing list