G
Giovanni Bajo
Hello,
with Visual Studio .NET 2003:
__declspec(align(1))
struct X {
unsigned int x : 3;
unsigned int y : 13;
};
sizeof(X) is 4, even with /Zp1 and/or pragma pack(1). I would expect it to
be 2.
Is there any way I can get the behaviour I need? It looks like I'm forced to
use short* and manually extract the bits. FYI, this works with GCC as
expected.
Thanks,
Giovanni Bajo
with Visual Studio .NET 2003:
__declspec(align(1))
struct X {
unsigned int x : 3;
unsigned int y : 13;
};
sizeof(X) is 4, even with /Zp1 and/or pragma pack(1). I would expect it to
be 2.
Is there any way I can get the behaviour I need? It looks like I'm forced to
use short* and manually extract the bits. FYI, this works with GCC as
expected.
Thanks,
Giovanni Bajo