https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70717
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|NEW |RESOLVED See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=79214, | |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=79220 Resolution|--- |FIXED Severity|normal |enhancement --- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- The -Wstringop-overflow option has been added to warn on many of these types of problems. Unfortunately, it doesn't handle this particular case because GCC transforms the memcpy call to assignment before the warning gets a chance to detect it. It's also defeated by the -Wno-system-headers option on systems that define memcpy et al. as macros in <string.h>. Since these limitations are being tracked in other bugs (the former in bug 79220 and the latter in bug 79214) I'll go ahead and resolve this enhancement request as fixed. Please open new bugs with any additional requests or for new problems in -Wstringop-overflow.