The gcc compiler option -fms-extensions
will allow non-standard anonymous structs without warning.
(That option enables what it considers "Microsoft extensions")
You can also achieve the same effect in valid C++ using this convention.
union Byte
{
struct bits_type {
unsigned int _0: 1;
unsigned int _1: 1;
unsigned int _2: 1;
unsigned int _3: 1;
unsigned int _4: 1;
unsigned int _5: 1;
unsigned int _6: 1;
unsigned int _7: 1;
} bit;
struct nibbles_type {
unsigned int _0: 4;
unsigned int _1: 4;
} nibble;
unsigned char byte;
};
With this, your non-standard byte.nibble_0
becomes the legal byte.nibble._0