This is the mail archive of the gcc@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]

gcc align.


hi ,
   i want  to use __attribute__ ((aligned(x)))
  on some  pIII , RedHat 6.2 box.
my problem is:
1.
  i use this

 struct {
        char a ;
         unsigned short b;
         char c;
} me __attribute__((aligned(4))) ;

and
 struct {
        char a ;
         unsigned short b;
         char c;
} me2;

i print the size of me and me2,  but their size is the same .  I want  me
align in 4 bytes, how to get it?

2.
i want all the struct in some c file  align in 4 bytes,  but if i use
__attribute__, it only works in one struct.

how can i  do this in gcc ?

thanks
                                renwei.


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