https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84685

            Bug ID: 84685
           Summary: Designated initializers warning
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: davranfor at yahoo dot es
  Target Milestone: ---

Created attachment 43554
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43554&action=edit
Designated initializer warning using compound literal

Compiling with `-std=c99 -Wextra` and using a compound literal to initialize a
member in a designated initializer:

struct T { int a; int *b; int c; }; 

struct T t = {.b = (int[]){1}};

Raises a warning 

missing initializer for field ‘c’ of ‘struct T’
[-Werror=missing-field-initializers]

This happens when the initialized member is not the last member of the struct.

Reply via email to