This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/85420] More -Wrestrict false positives with -fsanitize=undefined
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Apr 2018 16:13:04 +0000
- Subject: [Bug middle-end/85420] More -Wrestrict false positives with -fsanitize=undefined
- Auto-submitted: auto-generated
- References: <bug-85420-4@http.gcc.gnu.org/bugzilla/>
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.