This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

size of struct with aligned attributes


I all,

I have the following code:

struct
{
  float v[25] __attribute__((align(16)));
}

the size of this struct is 28*4.

Is there a rule (documented somewhere) in gcc which says that the
size of a struct with aligned attributes is a multiple of the required
alignment (in this case 16)?

note that if I declare the following :

struct
{
  float v[25] __attribute__((align(32)));
}

the size of this is a multiple of 32.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]