second draft: add Bitfields to D

Jonathan M Davis newsgroup.d at jmdavisprog.com
Wed May 1 06:20:45 UTC 2024


On Tuesday, April 30, 2024 2:48:46 PM MDT Timon Gehr via dip.development 
wrote:
> Well, I am bringing it up because the DIP draft ignores type qualifiers
> so far (and explicitly only lists unqualified types for support). What
> is happening with `shared` I think has not been fully pinned down, but
> last I heard the goal was to get implicit atomics.

Atila was talking about possibly doing implicit atomics, and we may get
that, but either way, for types that _can't_ use atomics (like bitfields),
it's pretty clearly going to have to be the case that they can't be read or
written to without casting if shared is actually going to protect against
accessing shared data in a manner which isn't guaranteed to be thread-safe
like it's theoretically supposed to and -preview=nosharedaccess is supposed
to enforce.

So, the normal rules for type qualifiers should apply to bitfields exactly
like they would with any other type, and there shouldn't be any surprises
here, but yes, if we want to be thorough about things, then the DIP should
probably mention what happens with type qualifiers.

- Jonathan M Davis





More information about the dip.development mailing list