Skip to content

[clang] Document -fstrict-flex-arrays option #138388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,11 @@ def fstrict_flex_arrays_EQ : Joined<["-"], "fstrict-flex-arrays=">, Group<f_Grou
Visibility<[ClangOption, CC1Option]>,
NormalizedValuesScope<"LangOptions::StrictFlexArraysLevelKind">,
NormalizedValues<["Default", "OneZeroOrIncomplete", "ZeroOrIncomplete", "IncompleteOnly"]>,
HelpText<"Enable optimizations based on the strict definition of flexible arrays">,
HelpText<"Enable optimizations based on the strict definition of flexible arrays.">,
DocBrief<[{If ``<n>`` is equal to 0, any trailing array member is considered a flexible array.
If ``<n>`` is equal to 1, trailing array members of size 0, 1 or undefined are considered flexible arrays.
If ``<n>`` is equal to 2, trailing array members of size 0 or undefined are considered flexible arrays.
If ``<n>`` is equal to 3, only trailing array members of undefined size are considered flexible arrays.}]>,
MarshallingInfoEnum<LangOpts<"StrictFlexArraysLevel">, "Default">;
defm apple_pragma_pack : BoolFOption<"apple-pragma-pack",
LangOpts<"ApplePragmaPack">, DefaultFalse,
Expand Down
Loading