23.2 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 features 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.
The following table indicates the various levels of compatibility used in the tables that are presented throughout this guide.
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. |
Note that even if a C feature is supported by an MPLAB XC compiler, addresses, register 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.