23.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 XC16, MPLAB XC-DSC and MPLAB XC32 C compilers in compatibility mode. The table below shows the pragmas and the level of support when using each of these MPLAB XC C compilers.
Many of these pragmas take arguments. Even if a pragma is supported by an MPLAB XC C compiler, this support may not apply to all of the pragma’s arguments. This is indicated in the following table.
IAR Compatibility Mode | |||
---|---|---|---|
Pragma | XC16 | XC-DSC | XC32 |
bitfields |
ignore | ignore | ignore |
data_alignment |
support | 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 |
support | support | support |
message |
native support | native support | native support |
object_attribute |
ignore | ignore | ignore |
optimize |
native support | native support | native support |
pack |
native support | native support | native support |
__printf_args |
support | support | support |
required |
support | support | support |
rtmodel |
ignore | ignore | ignore |
__scanf__args |
support | support | support |
section |
support | support | support |
segment |
support | support | support |
swi_number |
ignore | ignore | ignore |
type_attribute |
ignore | ignore | ignore |
weak |
native support | native support | native support |