bit fields

Paul Backus snarwin at gmail.com
Mon Aug 30 19:40:35 UTC 2021


On Monday, 30 August 2021 at 18:39:20 UTC, Walter Bright wrote:
> On 8/29/2021 11:32 PM, Elronnd wrote:
>> On Saturday, 28 August 2021 at 08:20:25 UTC, Walter Bright 
>> wrote:
>>> how gcc/clang do it is essentially undocumented
>> 
>> x86-64-psABI, sec 3.1.2 (data representation)
>
> https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf
>
> That only partially documents it. It doesn't cover things like 
> alignment and 0 length fields.

Zero-length bitfields are covered by the C standard:

> As a special case, a bit-field structure member with a width of 
> 0 indicates that no further bit-field is to be packed into the 
> unit in which the previous bit-field, if any, was placed.

Source: http://port70.net/~nsz/c/c99/n1256.html#6.7.2.1p11


More information about the Digitalmars-d mailing list