https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113515
Bug ID: 113515 Summary: Wrong documentation for -Wstringop-overflow Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: sandra at gcc dot gnu.org Target Milestone: --- This is essentially the example for -Warray-parameter=1 in the manual (see PR102998): #include <stdlib.h> void f (int[static 4]); void f (int[]); // warning 1 void g (void) { int *p = (int *) malloc (1 * sizeof(int)); f (p); // warning 2 } Warning 2 is: example.c: In function 'g': example.c:9:3: warning: 'f' accessing 16 bytes in a region of size 4 [-Wstringop-overflow=] 9 | f (p); | ^~~~~ example.c:9:3: note: referencing argument 1 of type 'int[4]' example.c:4:6: note: in a call to function 'f' 4 | void f (int[]); | ^ It's correct to warn here, but the manual is not helpful in explaining what -Wstringop-overflow has to do with it. The documentation for -Wstringop-overflow says: Warn for calls to string manipulation functions such as @code{memcpy} and @code{strcpy} that are determined to overflow the destination buffer. There are no string manipulation functions in this example. I presume additional kinds of object-size checking, beyond calls to string/byte array manipulation functions from the standard library, were overloaded onto this option without updating its description. Can we get a better summary of what it does now?