24.7 Pragmas
Pragmas may be used by a compiler to control code generation. Any compiler will ignore an unknown pragma, but many pragmas implemented by another compiler have also been implemented by the MPLAB XC compilers in compatibility mode. The table below shows the pragmas and the level of support when using each of the MPLAB XC compilers.
Many of these pragmas take arguments. Even if a pragma is supported by an MPLAB XC compiler, this support may not apply to all of the pragma’s arguments. This is indicated in the following table.
IAR Compatibility Mode | |||
---|---|---|---|
Pragma | XC8 | XC16 | XC32 |
bitfields | ignore | ignore | ignore |
data_alignment | ignore | support | support |
diag_default | ignore | ignore | ignore |
diag_error | ignore | ignore | ignore |
diag_remark | ignore | ignore | ignore |
diag_suppress | ignore | ignore | ignore |
diag_warning | ignore | ignore | ignore |
include_alias | ignore | ignore | ignore |
inline | support (no args) | support (no args) | support (no args) |
language | ignore | ignore | ignore |
location | ignore | support | support |
message | support | native support | native support |
object_attribute | ignore | ignore | ignore |
optimize | ignore | native support | native support |
pack | ignore | native support | native support |
__printf_args | support | support | support |
required | ignore | support | support |
rtmodel | ignore | ignore | ignore |
__scanf__args | ignore | support | support |
section | ignore | support | support |
segment | ignore | support | support |
swi_number | ignore | ignore | ignore |
type_attribute | ignore | ignore | ignore |
weak | ignore | native support | native support |