Hello Sam,
On 11/24/26 00:35, Sam James wrote:
Why Clang >= 20? Clang has supported this flag since forever.
at https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html it reads: Clang now emits distinct type-based alias analysis tags for incompatible pointers by default, enabling more powerful alias analysis when accessing pointer types. This change may silently change code behavior for code containing strict-aliasing violations.
Note that -Wstrict-aliasing=1 is the most aggressive level [0].
It also says "least accurate".
Anyway, in terms of detection, Clang has TypeSanitizer (-fsanitize=type) but it has some issues still. Someone has proposed it for GCC now too. [0] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict-aliasing
I'm in the process of adding Clang's TypeSanitizer to CI. Best Sebastian
