I got a program in a book
#include
int main( )
{
struct data
{
int a __attribute__( ( aligned ( 8 ) ) ) ;
char ch
The aligned(N) attribute aligns the current data item on an address which is a multiple of N, by inserting padding bytes before the data item. You appear to expect that it does something with packing, which is different.
Your structure appears to be laid out as follows:
Address Member
------- -------
2280712 a [address aligned on multiple of 8]
2280713 a
2280714 a
2280715 a
2280716 ch [address aligned on multiple of 1]
2280717 (unused)
2280718 (unused)
2280719 (unused)
2280720 s [address aligned on multiple of 4]
2280721 s
2280722 s
2280723 s