[Bug tree-optimization/94335] False positive -Wstringop-overflow warning with -O2
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 26 07:01:14 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
You should be using (intptr_t)t - (intptr_t)this when computing the relative
pointer, not sure if that makes a difference but pointer difference between
pointers to different objects invokes undefined behavior.
More information about the Gcc-bugs
mailing list