A-25 Bitfields of greater than field size

Cary Coutant cary at cup.hp.com
Mon Feb 7 19:11:54 UTC 2000


>(I must admit, though, that my other conclusion is that such a user
>quite likely doesn't know what he's doing.  Does anyone know what the
>rationale for this feature was?)

The only possible rationale I can imagine is to get a degree of 
independence from the machine-specific data representations. Perhaps the 
programmer is trying to create a structure whose external representation 
is the same on another machine, where int might be 64 bits. If that's the 
case, I'd think it's important to allocate 64 bits on a 64-bit boundary, 
and position the 32-bit int at the LSB end of the allocation (i.e., 
padding on the left).

That said, I'll admit that that's still a pretty lame rationale.

-cary




More information about the cxx-abi-dev mailing list