https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97264
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andreas Schwab from comment #5) > Why doesn't gcc warn about that? It does: unsigned char **q; void foo (char *p) { q = (unsigned char **)&p; } > gcc t.c -fstrict-aliasing -Wstrict-aliasing=2 -S t.i: In function 'foo': t.i:4:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] q = (unsigned char **)&p; ^ note the default level of -Wstrict-aliasing when enabled is 3 which will not warn when the pointer is not dereferenced in the same expression.