r/C_Programming • u/anduygulama • Jun 09 '26
packed attribute for structs
Why don't C compilers automatically optimize/pack structures instead of requiring explicit attributes?
2
Upvotes
r/C_Programming • u/anduygulama • Jun 09 '26
Why don't C compilers automatically optimize/pack structures instead of requiring explicit attributes?
View all comments
Show parent comment
4
u/zubergu Jun 09 '26
That's the only true answer here. C was invented and still is default language for writing operating systems and embedded. Default packed structs just are not in the spirit and application of the language.