Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 240 2012-2013 Microchip Technology Inc.
B.2 COMPILING IN COMPATIBILITY MODE
An option is used to enable vendor-specific syntax compatibility. When using MPLAB
XC8, this option is --ext=vendor; when using MPLAB XC16 or MPLAB XC32, the
option is -mext=vendor. The argument vendor is a key that is used to represent the
syntax. See Table B-1 for a list of all keys usable with the MPLAB XC compilers.
The Common Compiler Interface is a language standard that is common to all
Microchip MPLAB XC compilers. The non-standard extensions associated with this
syntax are already described in Chapter 2. Common C Interface and are not
repeated here.
B.3 SYNTAX COMPATIBILITY
The goal of this syntax compatibility feature is to ease the migration process when
porting source code from other C compilers to the native MPLAB XC compiler syntax.
Many non-standard extensions are not required when compiling for Microchip devices
and, for these, there are no equivalent extensions offered by MPLAB XC compilers.
These extensions are then simply ignored by the MPLAB XC compilers, although a
warning message is usually produced to ensure you are aware of the different compiler
behavior. You should confirm that your project will still operate correctly with these fea-
tures disabled.
Other non-standard extensions are not compatible with Microchip devices. Errors will
be generated by the MPLAB XC compiler if these extensions are not removed from the
source code. You should review the ramifications of removing the extension and decide
whether changes are required to other source code in your project.
Table B-2 indicates the various levels of compatibility used in the tables that are pre-
sented throughout this guide.
Note that even if a C feature is supported by an MPLAB XC compiler, addresses, reg-
ister names, assembly instructions, or any other device-specific argument is unlikely to
be valid when compiling for a Microchip device. Always review code which uses these
items in conjunction with the data sheet of your target Microchip device.
TABLE B-1: VENDOR KEYS
Vendor
key
Syntax
XC8
Support
XC16
Support
XC32
Support
cci Common Compiler Interface Yes Yes Yes
iar IAR C/C++ Compiler
TM
for ARM Yes Yes Yes
TABLE B-2: LEVEL OF SUPPORT INDICATORS
Level Explanation
support The syntax is accepted in the specified compatibility mode, and its
meaning will mimic its meaning when it is used with the original compiler.
support (no args) In the case of pragmas, the base pragma is supported in the specified
compatibility mode, but the arguments are ignored.
native support The syntax is equivalent to that which is already accepted by the MPLAB
XC compiler, and the semantics are compatible. You can use this feature
without a vendor compatibility mode having been enabled.
ignore The syntax is accepted in the specified compatibility mode, but the implied
action is not required or performed. The extension is ignored and a warning
will be issued by the compiler.
error The syntax is not accepted in the specified compatibility mode. An error will
be issued and compilation will be terminated.
Protego_Release_01_05-Related-OEM-Documentation-MPLAB-XC16-C-Compiler.pdf