Page 2 of 2

Re:GRUB and protected mode

Posted: Fri Jul 01, 2005 5:09 pm
by TheUnbeliever
I believe, although I may be wrong, that setting attribute packed means that any excess padding is removed, to allow for structures to be aligned as required by a specific protocol?

Re:GRUB and protected mode

Posted: Fri Jul 01, 2005 8:16 pm
by AR
__attribute__ sets an attribute, the __packed__/packed attribute removes padding between variables in a struct. It is only generally used for fulfilling specific interfaces like BIOS Data as unpacked (aligned) data improves performance.

There are also other attributes such as noreturn for functions that cause GCC to assume that the path of execution is going to terminate and not come back.