Re: alignment of array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



massimiliano cialdi wrote:
> I need to change this:
> 
> char Array0[N] __attribute__ ((aligned (4)));
> char Array1[M] __attribute__ ((aligned (4)));
> 
> In something like this:
> 
> typedef char myType_t __attribute__ ((aligned (4)));
> myType_t Array0[N];
> myType_t Array1[M];
> 
> but of course in this case the compiler gives me the following error
> "alignment of array elements is greater than element size"
> 
> Is there a way to declare a type in such a way that ie Array0 and
> Array1 are automatically aligned without using __attribute__ ?

A union with a larger type would work.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux