This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/85420] More -Wrestrict false positives with -fsanitize=undefined


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85420

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Franz Sirl from comment #3)
> Hmm, this maybe creduce'd too much, the original source reads more like
> 
>    strcpy(b, b + a + 10);
> 
> which would be only UB for sure if strlen(b + a + 10) >= 9, or?

If b was actually a larger array, then yes, otherwise even b + 10 would be UB.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]