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.
IAR Compatibility Mode | ||
---|---|---|
Pragma | XC-DSC | XC32 |
bitfields |
ignore | ignore |
data_alignment |
support | support |
default_variable_attributes |
ignore | native support (section attribute) |
default_function_attributes |
ignore | native support (section attribute) |
diag_default |
ignore | ignore |
diag_error |
ignore | ignore |
diag_remark |
ignore | ignore |
diag_suppress |
ignore | ignore |
diag_warning |
ignore | ignore |
include_alias |
ignore | ignore |
inline |
support (no args) | support (no args) |
language |
ignore | ignore |
location |
support | support |
message |
native support | native support |
object_attribute |
ignore | ignore |
optimize |
native support | native support |
pack |
native support | native support |
__printf_args |
support | support |
required |
support | support |
rtmodel |
ignore | ignore |
__scanf__args |
support | support |
section |
support | support |
segment |
support | support |
swi_number |
ignore | ignore |
type_attribute |
ignore | ignore |
weak |
native support | native support |