[Bug middle-end/85420] More -Wrestrict false positives with -fsanitize=undefined
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Apr 16 15:38:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85420
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The #c0 testcase is always UB if the function is called, why doesn't it deserve
a warning? Either a is initially 0, then already the first iteration invokes
UB (strcpy (b, b)) and -Wrestrict is right, or a is 1 and strcpy (b, b + 1)
invokes UB because it dereferences b[1] in the first iteration, or a is
different and and b + a invokes UB.
More information about the Gcc-bugs
mailing list