https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87192
Bug ID: 87192 Summary: -Warray-bounds (even =2) does not work on struct members Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugdal at aerifal dot cx Target Milestone: --- Minimal test case: void bar(void *); void foo() { struct { int a[10]; } s; bar(s.a+12); } Compiles without warning with -O2 -Warray-bounds=2. Tested on gcc 7.3.