4 IAR Pragmas

This section shows a summary of IAR pragmas and the best MPLAB XC8 replacement where that is available. These pragmas and their MPLAB XC8 equivalents are discussed in more detail in the sections that follow. It is recommended that you compare the relevant sections in the MPLAB® XC8 C Compiler User's Guide for AVR MCUs with those in your IAR C/C++ Compiler User Guide to ensure that migrated code will work as expected in all situations.

Table 4-1. MPLAB XC8 Equivalents to IAR Pragmas
IAR Pragma

(links to explanatory section)

Suggested MPLAB XC8 Migration
CX_RANGE_LIMITEDThe pragma can be removed
FENV_ACCESSThe pragma can be removed
FP_CONTRACTNo simple migration recommended
basic_template_matchingNo simple migration recommended
bitfieldsNo simple migration recommended
call_graph_rootNo simple migration recommended
callsNo simple migration recommended
constsegUse the section attribute
data_alignmentUse the aligned attribute
datasegUse the section attribute
default_function_attributesConsider the section attribute
default_variable_attributesConsider the typedef specifier and section attribute
diag_xxxxNo simple migration recommended
errorNo simple migration recommended
include_aliasNo simple migration recommended
inlineUse the always_inline or noinline attribute
languageNo simple migration recommended
locationUse the __at specifier and section attribute
messageNo simple migration recommended
object_attributeMigrate individual attributes specified by this pragma
optimizeNo simple migration recommended
printf_argsNo simple migration recommended
public_equUse the asm() statement
requiredNo simple migration recommended
rtmodelNo simple migration recommended
scanf_argsNo simple migration recommended
segmentThe pragma can be removed
type_attributeMigrate individual attributes specified by this pragma
vectorUse the __interrupt(number) specifier
weakUse the weak function attribute