2 Migration Overview
This guide describes the changes to source code and build options that might be required should you decide to migrate a C-based project from the AVR® 8-bit GNU Toolchain (referred to as AVR-GCC in this guide) to the Microchip MPLAB® XC8 C Compiler (MPLAB XC8).
Detailed in this guide are issues that must be considered to ensure that the migrated project works as expected. There should be little difference in implementation-defined behavior between the two compilers, but prudent programmers will not write code whose operation is dependent on such behavior.
In addition to the standard GCC feature set provided by AVR-GCC, MPLAB XC8 implements many unique language extensions and features. Some of these are also presented in this guide and should be explored to take full advantage of the tool. Many of these features are part of the Common C Interface (CCI). Code that complies with this interface can be more easily ported across all MPLAB XC compilers.
A migrated project will produce a HEX file that differs to that built using the original project and the AVR-GCC 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 MPLAB® XC8 C Compiler User’s Guide for AVR™ MCU for full information on how to use the MPLAB XC8 compiler and for more detailed information on the compiler's extensions and features.