Hi, This is the 3rd version of the patch set. Compare to the 2nd version, the following are the major change:
1. change the name of the option from -fstrict-flex-array to -fstrict-flex-arrays (per Kees' suggestion, this will be consistent with LLVM's option); 2. -std=c89 and ISO C++ will disable all -fstrict-flex-arrays; -std=gnu89 and C++ with GNU extension will disable -fstrict-flex-arrays=3 the attribute has the same impact. Issue warnings when the feature is disabled; 3. add testing cases for these new changes; 4. update documentation; 5. delete the common untility routine flexible_array_member_p, zero_length_array_p, one_element_array_p from tree.[ch], and move them to c/c-decl.cc since they are C/C++ specific concepts, should not be exposed in middle end. 6. not update component_ref_size routine in tree.cc, keep the original one; 7. handle the new IR bit in LTO streamer in/out per Richard's request; 8. handle the new IR bit in C++ modules per Richard's request with Nathan's help; 9. Print the new IR bit; 10. update array_at_struct_end_p to check the new IR bit DECL_NOT_FLEXARRAY to still keep array_at_struct_end_p as the common utility in middle-end; I have bootstrapped and regression tested on both aarch64 and x86, no issues. Let me know if you have any comments on the patches. thanks. Qing