[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays=<n> for stricter handling of flexible arrays

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 2 08:14:11 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/docs/ClangCommandLineReference.rst:2646
 
+.. option:: -fstrict-flex-arrays=<arg>, -fno-strict-flex-arrays
+
----------------
>From the top of this file:
```
  -------------------------------------------------------------------
  NOTE: This file is automatically generated by running clang-tblgen
  -gen-opt-docs. Do not edit this file by hand!!
  -------------------------------------------------------------------
```
so none of these changes are reflected at: https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fstrict-flex-arrays

This documentation needs to live alongside the option.


================
Comment at: clang/docs/ClangCommandLineReference.rst:2648
+
+Control which arrays are considered as flexible arrays members. <arg>
+can be 1 (array of size 0, 1 and undefined are considered) or 2 (array of size 0
----------------
This phrasing is problematic because it uses the term "flexible array members" which is a term of art in the standard when it's really talking about something else. We don't want `int trailing[1];` to be considered a flexible array member in terms of the language rules.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126864/new/

https://reviews.llvm.org/D126864



More information about the cfe-commits mailing list