This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29465] New: warning for overlapping memcpy()
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2006 21:08:16 -0000
- Subject: [Bug c/29465] New: warning for overlapping memcpy()
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I would like to propose that gcc (in both C and C++ modes) issue a warning
for calls to memcpy() with overlapping regions of memory (known at compile
time) such as the one below since the behavior of such calls is undefined.
#include <string.h>
int main ()
{
int i = 0;
memcpy (&i, &i, sizeof i);
return 0;
}
--
Summary: warning for overlapping memcpy()
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
GCC build triplet: all
GCC host triplet: all
GCC target triplet: all
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29465