This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Initializers for unnamed bitfields


GCC seems to ignore unnamed bitfields when initializing structures
with a brace-enclosed list.  Is this correct?  By my reading of the
standard, it's a bug.

struct test
{
  int : 8;
  int a:8;
};

struct test c = {5, 5};

$  gcc /tmp/foo.c -c
/tmp/foo.c:7: warning: excess elements in struct initializer
/tmp/foo.c:7: warning: (near initialization for `c')

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]