News for hackers. Stuff that matters.
Re:The Byte Order Fiasco by nly on Saturday May 08, 2021 @09:51AM (#27087118)
The library provides those functions too, but I don't see how having an arithmetic type with well defined size, endiannness and alignment is a bad thing.

If you're defining a struct to mirror a data structure from a device, protocol or file format then the language / type system should let you define the properties of the fields, not necessarily force you to introduce a parsing/decoding stage which could be more easily bypassed.

Re:The Byte Order Fiasco by lanstin on Saturday May 08, 2021 @02:06PM (#27089413)
It is no longer arithmetic if there is an endianness. Some things are numbers and some things are sequences of bytes. Arithmetic only works on the former.