1. 13
  1. 7

    But it is legal to wrap true flexible arrays in a struct that has at least 1 other non-true-flexible array, including an empty anonymous struct (i.e. taking up no size).

    struct obj {
           union {
                   struct {
                           struct { } __unused_member1;
                           struct foo name1[];
                   struct {
                           struct { } __unused_member2;
                           struct bar name2[];

    This is not legal for multiple reasons.

    C99 says

    the last member of a structure with more than one named member may have incomplete array type; such a structure (and any union containing, possibly recursively, a member that is such a structure) shall not be a member of a structure or an element of an array

    Additionally, struct {} is not valid C syntax. The grammar is

                      struct-or-union identifieropt { struct-declaration-list }
                     struct-declaration-list struct-declaration
                     specifier-qualifier-list struct-declarator-listopt ;

    so we need at least one struct-declaration to form a struct-declaration-list. Even if this were valid syntax, says

    If the struct-declaration-list contains no named members, the behavior is undefined.