This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Initializers for unnamed bitfields
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 26 Jan 2002 20:18:39 +0000
- Subject: 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.