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 table.

Table 24-7. Support for Non-Standard Pragmas
IAR Compatibility Mode
PragmaXC16/XC-DSCXC32
bitfieldsignoreignore
data_alignmentsupportsupport
default_variable_attributesignorenative support (section attribute)
default_function_attributesignorenative support (section attribute)
diag_defaultignoreignore
diag_errorignoreignore
diag_remarkignoreignore
diag_suppressignoreignore
diag_warningignoreignore
include_aliasignoreignore
inlinesupport (no args)support (no args)
languageignoreignore
locationsupportsupport
messagenative supportnative support
object_attributeignoreignore
optimizenative supportnative support
packnative supportnative support
__printf_argssupportsupport
requiredsupportsupport
rtmodelignoreignore
__scanf__argssupportsupport
sectionsupportsupport
segmentsupportsupport
swi_numberignoreignore
type_attributeignoreignore
weaknative supportnative support