<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/138185>138185</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] values for command-line flag `-fstrict-flex-arrays=` are undocumented and very confusing
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          zygoloid
      </td>
    </tr>
</table>

<pre>
    The possible values for the `-fstrict-flex-arrays=` flag are `0`, `1`, `2`, and `3`. However, the meanings of these values are undocumented. The [commit](https://github.com/llvm/llvm-project/commit/f764dc99b37e1e6428724a61f36bcb49c015dc70#diff-afc8a99103395a131471d199cf67e4d78836a5498c8db7d492582c65c0e648bd) that introduced the flag did include documentation, but unfortunately did so in the wrong way -- by editing an autogenerated file, instead of by editing the source of that file, so the documentation was lost the next time the file got regenerated. (It's present in Clang 15, but not in recent versions.)

The values are also mysterious and ~important~ confusing. We have:

- `0` means any array bound is a flexible array.
- `1` means an array bound of <= 1 is a flexible array (perhaps understandable).
- `2` means an array bound of 0 is a flexible array.
- `3` means no constant array bound indicates a flexible array.

This isn't how we design flags for the Clang command line; we should add aliases for those numbers that describe what the values actually do. Perhaps something like `any-bound`, `bound-0-or-1`, `bound-0`, and `strict`?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE2PKycQ_DX40hoLmO-DD293ZSW3HCLl3AM9MyQYLGDs5xzeb4_Au-vd5GmlnGb46IKqLgpjNIsjOrD2ibUvO9zS6sPh79virTd6N3l9O_y-Epx9jGayBBe0G0WYfYC0ErCOV3NMwahUzZa-VxgC3iKrX1jHYba4AIayjbOOM_mcf8XjV77-otN5WLOO7-EXf6ULhTyfzzgROuOWCH7O4_h-iYy8Oe3VdiKXSO8hX5W1T8qfTiax9oXJYU3pHFn9jckjk8fFpHWb9sqfmDxae3n7VOfg_ySV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