void foo(void) { int i[2]; i[2] = 0; i[3] = 0; } does not get warned on, even with -Wall. This might catch some subtle bugs in gcc itself.
-- Summary: does not warn for out-of-bound array access Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22546