S
stip
I'm trying to use a struct type like the following:
struct Compact
{
unsigned short int j : 7;
unsigned long k : 56;
unsigned char type : 1;
};
Why does the compiler complain about the second component? On my
system long has 8 bytes, thus 56 bits should fit into it. But the
compiler complains:
warning: declared size for bit field is larger than the size of the
bit field type; truncated to 32 bits
How can I tell the compiler to allow 64 bits, i.e. long? Or is the
maximal single bitfield component 32 bits?
struct Compact
{
unsigned short int j : 7;
unsigned long k : 56;
unsigned char type : 1;
};
Why does the compiler complain about the second component? On my
system long has 8 bytes, thus 56 bits should fit into it. But the
compiler complains:
warning: declared size for bit field is larger than the size of the
bit field type; truncated to 32 bits
How can I tell the compiler to allow 64 bits, i.e. long? Or is the
maximal single bitfield component 32 bits?