151
submitted 1 month ago by Sunshine@piefed.ca to c/linux@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] wizzim@infosec.pub 5 points 1 month ago

I am not a C developer, but I found the "helper has a terrible name" and "it's not clear what the helper is doing" arguments a bit weak.

Who in they right mind does not think the helper creates a 32 bytes word by putting the 16 bytes of the first argument followed by the 16 bytes of the second one ?

[-] traceur201@piefed.social 32 points 1 month ago

It's bits, not bytes. And endianness is a huge consideration in systems programming. And it's basically Linus' whole role at this point to enforce extreme consistency and standards since the project is so large with so many contributors

[-] FizzyOrange@programming.dev 7 points 1 month ago* (last edited 1 month ago)

Yeah it actually is fairly common to have the high word first because humans unfortunately picked the wrong endianness, and integers are written in big endian.

E.g. what value would you expect from u16x2_to_u32(0x1122, 0x3344)? If you said 0x11223344...

Still, the rant is stupid because all that needs to happen is to fix the name.

Honestly it's really surprising that the kernel doesn't already have a library of reliably but manipulation functions for common stuff like this.

this post was submitted on 10 Aug 2025
151 points (100.0% liked)

Linux

9322 readers
273 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS