[Bug c/94337] Incorrect "dereferencing type-punned pointer will break strict-aliasing rules" warning

2020-03-26 Thread vincent-gcc at vinc17 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94337

--- Comment #2 from Vincent Lefèvre  ---
Why not having a level with no false positives? This would avoid to disable the
warning globally.

IMHO, using it when a union is involved is likely to generate false positives.

[Bug c/94337] Incorrect "dereferencing type-punned pointer will break strict-aliasing rules" warning

2020-03-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94337

--- Comment #1 from Richard Biener  ---
The warning only looks at the single expression it quotes which isn't really
enough to discover you are doing right.  It tries to be helpful - if you know
better then disable the warning.