https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104355
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- The documentation is also incorrect about the warning being only active with -ftree-vrp. A small subset of -Warray-bounds is issued even without optimization. For example the following warning(s) have been issued since GCC 4.1: $ cat a.c && gcc -S -Wall a.c int f (void) { return __builtin_strlen ("123" + 5); } a.c: In function ‘f’: a.c:3:34: warning: offset ‘5’ outside bounds of constant string [-Warray-bounds] 3 | return __builtin_strlen ("123" + 5); | ~~~~~~^~~ a.c:3:10: warning: offset ‘5’ outside bounds of constant string [-Warray-bounds] 3 | return __builtin_strlen ("123" + 5); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~