The warning(s) below are confusing: 1) each mentions the argument type is 'int *' when it actually uses 'int[4]' to trigger, and 2) it doesn't point to the declaration of the object or subobject whose size it uses. In cases like pr99673 the missing details make the warning harder than necessary to understand and decide if it's a false positive. $ cat x.c && gcc -O -S -Wall x.c struct A { int a[2], b[2]; }; void f (int[4], int[4]); void g (int *p, int *q) { f (p, q); } void h (struct A *p) { g (p->a, p->b); } In function ‘g’, inlined from ‘h’ at x.c:12:3: x.c:7:3: warning: ‘f’ accessing 16 bytes in a region of size 8 [-Wstringop-overflow=] 7 | f (p, q); | ^~~~~~~~ x.c: In function ‘h’: x.c:7:3: note: referencing argument 1 of type ‘int *’ In function ‘g’, inlined from ‘h’ at x.c:12:3: x.c:7:3: warning: ‘f’ accessing 16 bytes in a region of size 8 [-Wstringop-overflow=] x.c: In function ‘h’: x.c:7:3: note: referencing argument 2 of type ‘int *’ x.c:3:6: note: in a call to function ‘f’ 3 | void f (int[4], int[4]); | ^
The warning should also not be -Wstringop-overflow or -Wstringop-overread (which are meant to be about accesses by functions declared in <string.h> and maybe also direct string accesses by pointers) but probably -Warray-bounds.