[Issue 23573] std.bitmanip.bitfields doesn't respect native endianness

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 21 23:46:01 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23573

--- Comment #3 from johanengelen at weka.io ---
(In reply to elpenguino+D from comment #2)
> 
> D doesn't need two undefined flavours of bitfields. Some people find it
> useful to be able to read bitfields from files or the network regardless of
> cpu architecture.

OK, fair point.
But then the bugreport should be rewritten without comparing it to C bitfields,
and instead specify exactly the bit layout as desired in bytes. It's not clear
to me what is meant, because (I think) the OP says that the order of bits
_within_ a byte is reversed depending on endianness, which does not give the
architecture independent behavior that you want.

--


More information about the Digitalmars-d-bugs mailing list