C bitfields guarantees

Timon Gehr timon.gehr at gmx.ch
Wed Jul 10 00:45:41 UTC 2024


On 7/10/24 02:32, Timon Gehr wrote:
> 
> error: bitfield layout is ambiguous
> 
> - add extern(C) to match the layout of the associated C compiler
> - add padding and/or 0-width bitfields to unambiguously start bitfields 
> on a T alignment boundary without straddling

Or change some of the bitfield types to ones with smaller alignment I 
guess. (If that is necessary at all. It's still not so obvious exactly 
what assumptions are portable in practice.)


More information about the Digitalmars-d mailing list