[clang] [clang] Strict aliasing warning ala GCC [PR50066] (PR #74155)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 21:00:47 PST 2023


MaskRay wrote:

Add @shafik who authors https://gist.github.com/shafik/848ae25ee209f698763cffee272a58f8 ("Although clang allows these flags it apparently does not actually implement the warnings")

> [*] I implemented what turned into GCC's level=1 way back when.

Cool!

FWIW the GCC doc is https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict-aliasing_003dn
It says for Level 3 "If optimization is enabled, it also runs in the back end, where it deals with multiple statement cases using flow-sensitive points-to information."

Do you know how it works? Any example?


https://github.com/llvm/llvm-project/pull/74155


More information about the cfe-commits mailing list