Microchip Technology SW006023-2 Hoja De Datos
MPLAB
®
XC32 C/C++ Compiler User’s Guide
DS51686E-page 34
2012 Microchip Technology Inc.
2.5.7.2
DIFFERENCES
The 8-bit compilers have used the four qualifiers bank0, bank1, bank2 and bank3 to
indicate the same, albeit more limited, memory placement.
indicate the same, albeit more limited, memory placement.
Equivalent specifiers have never been defined for any other compiler.
2.5.7.3
MIGRATION TO THE CCI
For 8-bit compilers, change any occurrence of the bankx qualifiers, as in the following
example:
example:
bank2 int logEntry;
to __bank(, i.e., __bank(2) int logEntry;
2.5.7.4
CAVEATS
None.
2.5.8
Alignment of Objects
The __align(alignment) specifier may be used to indicate that variables must be
aligned on a memory address that is a multiple of the alignment specified. The align-
ment term must be a power of two. Positive values request that the object’s start
address be aligned; negative values imply the object’s end address be aligned.
aligned on a memory address that is a multiple of the alignment specified. The align-
ment term must be a power of two. Positive values request that the object’s start
address be aligned; negative values imply the object’s end address be aligned.
Use the native keywords discussed in the Differences section to look up information on
the semantics of this specifier.
the semantics of this specifier.
2.5.8.1
EXAMPLE
The following shows variables qualified using __align() to ensure they end on an
address that is a multiple of 8, and start on an address that is a multiple of 2,
respectively.
address that is a multiple of 8, and start on an address that is a multiple of 2,
respectively.
__align(-8) int spacer;
__align(2) char coeffs[6];
2.5.8.2
DIFFERENCES
An alignment feature has never been implemented on 8-bit compilers.
The 16- and 32-bit compilers used the aligned attribute with variables.
2.5.8.3
MIGRATION TO THE CCI
For 16- and 32-bit compilers, change any occurrence of the aligned attribute, as in
the following example:
the following example:
char __attribute__((aligned(4)))mode;
to __align, i.e., __align(4) char mode;
2.5.8.4
CAVEATS
This feature is not yet implemented on XC8.