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.

Table 24-7. Support for Non-Standard Pragmas
IAR Compatibility Mode
PragmaXC8XC16XC32
bitfieldsignoreignoreignore
data_alignmentignoresupportsupport
diag_defaultignoreignoreignore
diag_errorignoreignoreignore
diag_remarkignoreignoreignore
diag_suppressignoreignoreignore
diag_warningignoreignoreignore
include_aliasignoreignoreignore
inlinesupport (no args)support (no args)support (no args)
languageignoreignoreignore
locationignoresupportsupport
messagesupportnative supportnative support
object_attributeignoreignoreignore
optimizeignorenative supportnative support
packignorenative supportnative support
__printf_argssupportsupportsupport
requiredignoresupportsupport
rtmodelignoreignoreignore
__scanf__argsignoresupportsupport
sectionignoresupportsupport
segmentignoresupportsupport
swi_numberignoreignoreignore
type_attributeignoreignoreignore
weakignorenative supportnative support