Skip to content

-fno-strict-aliasing usage - is it needed, and if so do we default to it? #25004

@rgommers

Description

@rgommers

The cibuildwheel config contains CFLAGS="-fno-strict-aliasing" here, specifically for building wheels on Linux and macOS. I've looked in the history of that, but couldn't really determine why this was added in this way. It doesn't make too much sense that we'd need it for our own wheel builds, but that users who build from source on the same platforms would not need it. So my guess is that it was added there to fix some particular problem and it was hard to add compiler flags with numpy.distutils in a more generic way, so we left it at patching up an issue found when testing wheels.

Does anyone remember?

I'd expect that if we need this flag, we need it for C++ too and not only for C. And that we should add it in the build system for compilers that support the flag, rather than only for wheels.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions