------- Comment #26 from rguenth at gcc dot gnu dot org 2006-02-18 13:44 ------- I agree that the false positives would be acceptable. One could even warn for [0] and [1] arrays if std=c99 (I believe flexible array members were not in c89, but i didn't check).
For a way to check if an array access can possibly cross structure extent you can look at tree-dfa.c:get_ref_base_and_extent which also accounts for flexible array members. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268