second draft: add Bitfields to D

Walter Bright newshound2 at digitalmars.com
Sat May 4 18:07:36 UTC 2024


On 5/3/2024 11:07 PM, Richard (Rikki) Andrew Cattermole wrote:
> On 23/04/2024 1:01 PM, Walter Bright wrote:
>> https://github.com/WalterBright/documents/blob/dcb8caabff76312eee25bb9aa057774d981a5bf7/bitfields.md
> 
> Randomly came across people talking about C bitfields, and how the non-defined 
> bit layout is causing them problems.
> 
> https://twitter.com/__phantomderp/status/1786628836953604201
> 
> Turns out even they think they need control over the layout including 
> predictable LSB..MSB byte by byte definition.
> 
> Making it default to C for the layout is not a good addition to the language.

All the tweet says is:

```
As they should.
(But now it's time for C and C++ to give users explicit layout control, so that 
eventually we can use our chairs on other more heinous programming criminals.)
```

I've responded thoroughly to every complaint about the layout. The only 
substantive external one is Linus', which is linked to in the DIP, and I 
responded to that, too.

If you don't like bitfields at this point, don't use them. If you need help 
getting a specific layout, post here and I can help you.


More information about the dip.development mailing list