"Designated (dot) Initializers" and "Unnamed struct/union fields" are regular 
constructs in gcc, though, they connot be parsed together.
(tested up to gcc 3.3.3)

typedef struct {
  union {
    long MV;
    int mv[2];
    struct {
      int x;
      int y;
    };
  }; 
  int z;
}foo_t;


foo_t foo[2] = {
  {
    .z=2,
    .mv={0,1},
  },
  {
    .z=5,
    .y=4,
    .x=3,
  },
};

foo_t foo2[2]= {
  {.z=2,.MV=0x00010000},
  {.z=5,.MV=0x00030002},
};

-- 
           Summary: "Designated (dot)  Initializers" with "Unnamed
                    struct/union fields within structs/unions"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benoit dot guerin at thomson dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24065

Reply via email to