News for hackers. Stuff that matters.
Re:The Lost Art of C Structure Packing (2014) by Grishnakh on Friday August 05, 2016 @01:50PM (#12234369)
Wouldn't it make sense for the compiler to automatically optimize stuff like this? The compiler knows all about the underlying architecture the code will be running on, so it's best positioned to determine how to order data for optimal efficiency.
Re:The Lost Art of C Structure Packing (2014) by to3m on Friday August 05, 2016 @01:54PM (#12234406)
The C rules don't permit it. Putting fields in the order specified is not the worst possible default.

(The option would be nice, though... most of the time, you don't care.)

Re:The Lost Art of C Structure Packing (2014) by nwmcsween on Friday August 05, 2016 @02:38PM (#12234793)
No as you might be poking hardware and having the compiler at best make something not work or at worst brick hardware is not good. Compilers can earn on padding, most with -Wpadding