This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29465] warning for overlapping memcpy()
- 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: Thu, 16 Feb 2017 00:53:59 +0000
- Subject: [Bug c/29465] warning for overlapping memcpy()
- Auto-submitted: auto-generated
- References: <bug-29465-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29465
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The -Wrestrict warning (new in GCC 7) points out this bug. Unfortunately, the
option is not in -Wall or -Wextra and must be explicitly enabled so few users
will benefit from it.
$ gcc -S -Wrestrict t.c
t.c: In function ‘main’:
t.c:6:13: warning: passing argument 1 to restrict-qualified parameter aliases
with argument 2 [-Wrestrict]
memcpy (&i, &i, sizeof i);
^~ ~~
*** This bug has been marked as a duplicate of bug 35503 ***