3 Introduction

This guide describes the source code changes that might be required should you decided to migrate a C-based project from the IAR C/C++ Compiler for Arm® to the Microchip MPLAB® XC32 C Compiler.

When migrating the project's source code, the majority of the required changes will be to non-standard keywords (referred to as extended keywords by IAR), pragmas, and built-in functions (referred to as intrinsic functions by IAR). Each of these IAR compiler features and the recommended migration steps are described in turn in the sections following. Differences in implementation-defined behavior between the two compilers are not considered here. The MPLAB XC32 compiler offers a different set of language extensions and features to those provided by the IAR compiler. These should be explored to take full advantage of the tool. Additionally, different command-line options are used to control how code is built.

A migrated project will produce a HEX file that differs to that built using the original project and the IAR compiler, so any hash values calculated from the final program image will need to be recalculated. Objects and functions will almost certainly be linked at different addresses. Differing code generation strategies and optimizations might affect any code that relies on the timing of its execution.

See the documentation for the MPLAB® XC32 C/C++ C Compiler for information on how to use the compiler and for more detailed information on the compiler's extensions and features.