https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70717
Bug ID: 70717 Summary: -fsanitize=object-size as warning Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: aleks at physik dot tu-berlin.de CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- a new warning could detect problems earlier than "-fsanitize=object-size". The following code is wrong, should be detected by "-fsanitize=object-size", but it could be detected already at compile-time, especially for memset/memcpy/memcmp . char a[8], b[16]; memcpy(a,b,sizeof(b)); // write out of bounds, a[8..15] does not exist Thanks for reading