https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71567
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- -fsanitize=undefined can be used to find some of these. This enables: -fsanitize=bounds This option enables instrumentation of array bounds. Various out of bounds accesses are detected. Flexible array members, flexible array member-like arrays, and initializers of variables with static storage are not instrumented. Note the last part of it too because without dummy, GCC considers the array as "flexible array member-like arrays"