Message ID | 20230803163117.1016079-1-qing.zhao@oracle.com |
---|---|
State | New |
Headers | show |
Series | Add documentation for -Wflex-array-member-not-at-end. | expand |
On Thu, 3 Aug 2023, Qing Zhao via Gcc-patches wrote: > +@opindex Wflex-array-member-not-at-end > +@opindex Wno-flex-array-member-not-at-end > +@item -Wflex-array-member-not-at-end I'd expect this to have @r{(C and C++ only)} to indicate what languages the option applies to. OK with that change.
Thanks. I just updated the doc per your suggestion and committed as: https://gcc.gnu.org/pipermail/gcc-cvs/2023-August/387588.html Qing > On Aug 3, 2023, at 1:29 PM, Joseph Myers <joseph@codesourcery.com> wrote: > > On Thu, 3 Aug 2023, Qing Zhao via Gcc-patches wrote: > >> +@opindex Wflex-array-member-not-at-end >> +@opindex Wno-flex-array-member-not-at-end >> +@item -Wflex-array-member-not-at-end > > I'd expect this to have @r{(C and C++ only)} to indicate what languages > the option applies to. OK with that change. > > -- > Joseph S. Myers > joseph@codesourcery.com
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index adb10a3528da..0e7d827d355f 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -357,6 +357,7 @@ Objective-C and Objective-C++ Dialects}. -Wempty-body -Wno-endif-labels -Wenum-compare -Wenum-conversion -Wenum-int-mismatch -Werror -Werror=* -Wexpansion-to-defined -Wfatal-errors +-Wflex-array-member-not-at-end -Wfloat-conversion -Wfloat-equal -Wformat -Wformat=2 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral -Wformat-overflow=@var{n} @@ -9312,6 +9313,18 @@ value, like assigning a signed integer expression to an unsigned integer variable. An explicit cast silences the warning. In C, this option is enabled also by @option{-Wconversion}. +@opindex Wflex-array-member-not-at-end +@opindex Wno-flex-array-member-not-at-end +@item -Wflex-array-member-not-at-end +Warn when a structure containing a C99 flexible array member as the last +field is not at the end of another structure. +This warning warns e.g. about + +@smallexample +struct flex @{ int length; char data[]; @}; +struct mid_flex @{ int m; struct flex flex_data; int n; @}; +@end smallexample + @opindex Wfloat-conversion @opindex Wno-float-conversion @item -Wfloat-conversion