r/C_Programming • u/8d8n4mbo28026ulk • Jul 30 '26
Memory layout primitives
https://napcakes.nekoweb.org/posts/blayout/
40
Upvotes
r/C_Programming • u/8d8n4mbo28026ulk • Jul 30 '26
2
u/skeeto Aug 03 '26
This should be possible in the next C standard, and it's already defined behavior in Clang and GCC if you use
-std=c2y.Thanks! I've added it to my reader. Don't forget to update the link on the main page, too.
2
u/vitamin_CPP Aug 10 '26 edited Aug 10 '26
This is a high-quality article; thank you for sharing it.
Practically, I prefer solving this problem with a macro. Obviously, creating a new type for each
Nis not the best for API design13
u/Snarwin Jul 30 '26
Fun fact: the first programming language to natively support structs was actually COBOL, with its RECORD types.
8
u/TheOtherBorgCube Jul 30 '26
I got distracted by the 43 uses of the "!" exclamation. It's like the author just found a shiny thing on the floor and is now running round like an hyper-active kid.