On Mon, Mar 27, 2023 at 01:38:34PM +0000, Qing Zhao wrote: > > > > On Mar 23, 2023, at 4:14 PM, Joseph Myers <jos...@codesourcery.com> wrote: > > > > On Thu, 23 Mar 2023, Qing Zhao via Gcc-patches wrote: > > > >> +Wgnu-variable-sized-type-not-at-end > >> +C C++ Var(warn_variable_sized_type_not_at_end) Warning > >> +Warn about structures or unions with C99 flexible array members are not > >> +at the end of a structure. > > > > I think there's at least one word missing here, e.g. "that" before "are". > > Will fix it. > > > >> +Please use warning option @option{-Wgnu-variable-sized-type-not-at-end} > >> to > >> +identify all such cases in the source code and modify them. This > >> extension > >> +will be deprecated from gcc in the next release. > > > > We don't generally say "in the next release" in the manual (or "deprecated > > from gcc"). Maybe it *is* deprecated, maybe it will be *removed*, or will > > *start to warn by default*, in some specified version number (giving a > > version number seems better than "next release"), but "will be deprecated" > > is odd. > How about the following: > > +Please use warning option @option{-Wgnu-variable-sized-type-not-at-end} to
This is certainly misnamed. GNU variable sized type not at the end of a struct is something like void bar (void *); void foo (int n) { struct S { int a; int b[n]; int c; } s; s.a = 1; __builtin_memset (s.b, 0, sizeof (s.b)); s.c = 3; bar (&s); } Certainly not flexible array members in the middle of structure. > +identify all such cases in the source code and modify them. This warning > will be > + on by default starting from GCC14. Jakub