bit fields

TheGag96 thegag96 at gmail.com
Tue Aug 31 04:47:56 UTC 2021


On Tuesday, 31 August 2021 at 01:04:57 UTC, Paul Backus wrote:
> On Monday, 30 August 2021 at 22:45:36 UTC, TheGag96 wrote:
>> On Saturday, 28 August 2021 at 08:20:25 UTC, Walter Bright 
>> wrote:
>>> 3. DasBetterC is not in a great place since it can't do 
>>> matching bit fields.
>>
>> I think I may be experiencing a bug in a betterC project of 
>> mine as a result of me assuming that `bitfields` is doing the 
>> same thing as gcc would...! Is there a way I can get things 
>> synced up on at least one platform in the meantime?
>
> Don't use bitfields for anything that needs to have a stable 
> ABI. They're not even guaranteed to have the same layout when 
> using the same compiler on different platforms [1], much less 
> between different languages.
>
> [1] https://yarchive.net/comp/linux/bitfields.html

I'm working on a single, very specific platform, and the library 
I'm interfacing with was the one who chose to make data 
structures that had bitfields, not me.


More information about the Digitalmars-d mailing list