------- Comment #24 from rguenth at gcc dot gnu dot org 2006-02-18 13:15 ------- (In reply to comment #22)
We need to allow offsetting beyond the declared array size if this array is the last member of a structure. This is refered to as "malloc trick" to allocate variable sized structures with a flexible array member. Due to compilers lacking support for the correct char str[] declaration you will find all of char str[0] (GNU extension) char str[] char str[1] char str[4] (or whatever number) so in this case we need to allow all accesses, or with a separate warning flag only warn if the decl was not one of [0], [] or [1]. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268