GNU compatibility: alignof applied to packed fields

Submit New Article

December 23, 2008 11:00 PM PST


In GNU modes, applying the __alignof operator to a field selection operation for a packed field now produces the value 1.  (Previously, the "packed" attribute was ignored in such cases.)  For example:

struct S { int i __attribute__((packed)); } s;
int main() {
return __alignof(s.i); // Returns 1.
}

 



Do you need more help?


This article applies to: Intel Software Network communities,   Intel SW Partner program,   Intel® AppUp(SM) Developer Community,   Intel® C++ Compiler for Linux* Knowledge Base,   Intel® Software Development Tool Suites for Intel® Atom™ Processor Knowledge Base