Type Attributes

The type attribute aligned is optional in declarations and do not actually affect the type of declared object.

Attribute aligned

This attribute specifies a minimum alignment (in bytes) for variables of the specified type. For example, the declarations:

typedef aligned(32) int aligned32_int;

or alternative syntax :

typedef __attribute__((aligned (32))) int aligned32_int;

This will force the compiler to insure that each variable whose type is aligned32_int will be allocated and aligned at least on a 32-byte boundary.
The aligned attribute can only increase the alignment, but you can decrease it by specifying packed as well.

Copyright (c) 2002-2015 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code