This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60256] No -Wuninitialized warning for strcpy copying to self
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Jan 2017 18:05:43 +0000
- Subject: [Bug c/60256] No -Wuninitialized warning for strcpy copying to self
- Auto-submitted: auto-generated
- References: <bug-60256-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60256
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the reference. The strcmp(s, s) (and likewise memcmp(p, p, n)) case
in bug 65452 is different because unlike this one, strcmp doesn't change the
arrays pointed to by its arguments (which are also not declared restrict) and
so calling the function with the same array is valid.