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.

Table 23-7. Support for Non-Standard Pragmas
IAR Compatibility Mode
PragmaXC16XC-DSCXC32
bitfieldsignoreignoreignore
data_alignmentsupportsupportsupport
diag_defaultignoreignoreignore
diag_errorignoreignoreignore
diag_remarkignoreignoreignore
diag_suppressignoreignoreignore
diag_warningignoreignoreignore
include_aliasignoreignoreignore
inlinesupport (no args)support (no args)support (no args)
languageignoreignoreignore
locationsupportsupportsupport
messagenative supportnative supportnative support
object_attributeignoreignoreignore
optimizenative supportnative supportnative support
packnative supportnative supportnative support
__printf_argssupportsupportsupport
requiredsupportsupportsupport
rtmodelignoreignoreignore
__scanf__argssupportsupportsupport
sectionsupportsupportsupport
segmentsupportsupportsupport
swi_numberignoreignoreignore
type_attributeignoreignoreignore
weaknative supportnative supportnative support