[GCC13,V6,0/2] Add a new option -fstrict-flex-arrays[=n] and attribute strict_flex_array(n) and use it in PR101836

Message ID 20221005191320.2087486-1-qing.zhao@oracle.com
Headers
Series Add a new option -fstrict-flex-arrays[=n] and attribute strict_flex_array(n) and use it in PR101836 |

Message

Qing Zhao Oct. 5, 2022, 7:13 p.m. UTC
  This is the 6th version of the patch set.
Compare to the 5th version, the major change is: (Address Joseph's
comment on the attribute):

1. to require the attribute to be applied to a declaration;
(c-family/c-attribs.cc)
2. update testing case to include such case;
(testsuite/gcc.dg/strict-flex-array-1.c)

Compare to the 4th version, the following are the major change:(Address
Martin's comments).

  1. change the name of the attribute from "strict_flex_arrays" to
"strict_flex_array";
  2. update document to update all mentions of flexible array member
with additional qualification "for the purposes of accessing the
elements of such array".

Compare to the 3rd version, the following are the major change:

1. delete all the warnings for the confliction between -std and
-fstrict-flex-arrays per our discussion.
2. delete all the related testing cases for these warnings.
3. update all the wording changes, and documentation format changes
recommanded by Joseph.

I have bootstrapped and regression tested on both aarch64 and x86, no issues.

The above changes are all in documentation and FEs.

Since the Middle end change has been Okayed by Bichard in the V3 of the
patch review. So, Joseph, could you please take a look at the FE  and
doc changes and let me know whether they are good to commit?

thanks a lot.

Qing


Qing Zhao (2):
  Add a new option -fstrict-flex-arrays[=n] and new attribute
    strict_flex_array
  Use array_at_struct_end_p in __builtin_object_size [PR101836]