Strict aliasing, yes or no?

Just wondering what the position on this is. I've seen a few conflicting indications:

(1) The new meson patches pass -fno-strict-aliasing to GCC and Clang: The rationale is "We don't want to build buggy code." Well, technically, code that relies on aliasing is
inherently buggy from the outset, because that violates the standard. Assuming that's not something you strive for, the next bit is worse: I can't see an equivalent directive for MSVC. Surely this means, without forcing the compiler to make aliasing well-defined, code that relies on aliasing is free to start wildly bugging out on MSVC at any time?

(2) The Autotools build files do not seem to pass this flag, indicating that avoidance of strict aliasing was not a requirement.

(3) There's this old bug (and possibly others) to remove aliasing violations:

So, which is true? Do we want to forbid breaking strict aliasing rules, or do we want to require compilers that allow us to override the Standard and rely on aliasing violations?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]