BLD: Add clang `-ftrapping-math` also for `compiler_so` by seberg · Pull Request #19479 · numpy/numpy

@seberg seberg changed the title BLD: Add clang -ffp-exception-behavior=strict also for _so BLD: Add clang -ftrapping-math also for _so

Jul 15, 2021

@seberg

Apparently, there is a second `compiler_so` that is actually the
main compiler being used, and modifying only the first one is just
futile.

The old try was `-ffp-exception-behavior=strict`, but that seems to
be a fairly new addition (and doesn't even work on MacOS with 10.0)

`-ftrapping-math` seems to be the older, equivalent option.

@seberg

@seberg

@seberg seberg changed the title BLD: Add clang -ftrapping-math also for _so BLD: Add clang -ftrapping-math also for compiler_so

Jul 15, 2021

@seberg seberg deleted the fixup-clang-flag-try branch

July 18, 2021 20:27

This was referenced

Feb 9, 2022

rgommers added a commit to rgommers/numpy that referenced this pull request

Jun 27, 2023
The distutils build also uses this flag, and it avoids some problems
with `floor_divide` and similar functions (xref numpygh-19479).

rgommers added a commit to rgommers/numpy that referenced this pull request

Jun 27, 2023
The distutils build also uses this flag, and it avoids some problems
with `floor_divide` and similar functions (xref numpygh-19479).

For older macOS arm64 Clang versions, the flag does get accepted, but then
gets overridden because it's not actually supported - which yields these
warnings:
```
warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]
```
Since they're a little annoying to suppress and will go away when updating to
the latest XCode version, we'll ignore these warnings.

charris pushed a commit to charris/numpy that referenced this pull request

Jul 14, 2023
The distutils build also uses this flag, and it avoids some problems
with `floor_divide` and similar functions (xref numpygh-19479).

For older macOS arm64 Clang versions, the flag does get accepted, but then
gets overridden because it's not actually supported - which yields these
warnings:
```
warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]
```
Since they're a little annoying to suppress and will go away when updating to
the latest XCode version, we'll ignore these warnings.