sizeof(Bit Field) doesn't give any error

Tom Tromey tromey@redhat.com
Mon Oct 3 19:08:00 GMT 2011


>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> writes:

Abhijit> (gdb) ptype mBitField
Abhijit> type = struct tBitField {
Abhijit>      unsigned int f1 : 1;
Abhijit>      unsigned int f2 : 7;
Abhijit> }
Abhijit> (gdb) print sizeof(mBitField.f1)
Abhijit> $2 = 4

Abhijit> This should give error saying sizeof operator doesn't work for
Abhijit> bit field.

I think this is already in bugzilla, but if not, please file it.
That is the best place for bugs; on this list they just get forgotten.

Tom



More information about the Gdb-patches mailing list