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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #5)
> The warning for attachment 43950 [details] is intended and the bug is
> actually in failing to issue it without -fsanitize=undefined.  Unlike for
> raw memory functions such as memcpy, for string functions like strcpy
> -Wrestrict triggers even for possible overlaps. 

That is a bad decision.  The overlap is something much better caught at
runtime, where it can be accurately, and not just throw mostly false positive
warnings at user when there is nothing wrong with the code and hardly anything
that can be done to avoid the false positive warnings.
-fsanitize=address can diagnose strcpy etc. overlap just fine.

Reply via email to