GNU compatibility: alignof applied to packed fields

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.

}

 

Pour de plus amples informations sur les optimisations de compilation, consultez notre Avertissement concernant les optimisations.
Étiquettes: