Menu

#2810 Using designated initalizers with anonymous union

open
nobody
None
other
5
2018-09-10
2018-09-10
No

SDCC 3.7.2 #10539 refuses to compile this:

struct s
{
   union
   {
      int a;
      int b;
   };

   int c;
   int d;
};

struct s s2 = { .a = 0, .c = 3, .d = 4 };

Error messages:

test.c:13: warning 147: excess elements in struct initializer after 's2'
test.c:13: warning 147: excess elements in struct initializer after '__xinit_s2'

Philipp

Discussion


Log in to post a comment.

MongoDB Logo MongoDB