Jump to main content
MPLAB® XC32 C/C++ Compiler User's Guide for PIC32C/SAM MCUs
Search
Notice to Development Tools Customers
1
Preface
1.1
Conventions Used in This Guide
1.2
Recommended Reading
2
Compiler Overview
2.1
Device Support
2.2
Compiler Description and Documentation
2.3
Compiler and Other Development Tools
3
How To's
3.1
Installing and Activating the Compiler
3.2
Invoking the Compiler
3.3
Writing Source Code
3.4
Getting My Application To Do What I Want
3.5
Understanding the Compilation Process
3.6
Fixing Code That Does Not Work
4
XC32 Toolchain and MPLAB X IDE
4.1
MPLAB X IDE and Tools Installation
4.2
MPLAB X IDE Setup
4.3
MPLAB X IDE Projects
4.4
Project Setup
4.5
Project Example
5
Command-line Driver
5.1
Invoking the Compiler
5.2
The C Compilation Sequence
5.3
The C++ Compilation Sequence
5.4
Runtime Files
5.5
Compiler Output
5.6
Compiler Messages
5.7
Driver Option Descriptions
6
C Standard Issues
6.1
Divergence from the C99 Standard
6.2
Extensions to the C99 Standard
6.3
Implementation-Defined Behavior
7
Device-Related Features
7.1
Device Support
7.2
Device Header Files
7.3
Configuration Bit Access
7.4
Using SFRS From C Code
7.5
Tightly-Coupled Memories
7.6
Code Coverage
8
Supported Data Types and Variables
8.1
Identifiers
8.2
Data Representation
8.3
Integer Data Types
8.4
Floating-Point Data Types
8.5
Structures and Unions
8.6
Pointer Types
8.7
Complex Data Types
8.8
Constant Types and Formats
8.9
Standard Type Qualifiers
8.10
Compiler-Specific Qualifiers
8.11
Variable Attributes
9
Memory Allocation and Access
9.1
Address Spaces
9.2
Variables in Data Memory
9.3
Auto Variable Allocation and Access
9.4
Variables in Program Memory
9.5
Variables in Registers
9.6
Dynamic Memory Allocation
10
Chip-Level Security and Arm® TrustZone® Technology
10.1
ARMv8-M Security Extensions
10.2
Linker Macros Controlling Memory Regions for TrustZone®
11
Floating-point Support
11.1
Floating-point Calling Conventions
12
Fixed-Point Arithmetic Support
12.1
Enabling Fixed-Point Arithmetic Support
12.2
Data Types
12.3
Fixed-point Library Functions
12.4
Operations on Fixed-Point Variables
12.5
Unsupported Features
13
Operators and Statements
13.1
Integral Promotion
13.2
Type References
13.3
Labels as Values
13.4
Conditional Operator Operands
13.5
Case Ranges
14
Register Usage
14.1
Register Usage
14.2
Register Conventions
15
Stack
15.1
Software Stack
15.2
Call Frame
15.3
Stack Smashing Protector (SSP) for Target Devices with an Arm Cortex Core
15.4
Stack Guidance
16
Functions
16.1
Writing Functions
16.2
Function Attributes And Specifiers
16.3
Allocation of Function Code
16.4
Changing the Default Function Allocation
16.5
Function Size Limits
16.6
Function Parameters
16.7
Function Return Values
16.8
Calling Functions
16.9
Inline Functions
17
Interrupts
17.1
Interrupt Operation
17.2
Writing an Interrupt Service Routine
17.3
Associating a Handler Function With an Exception
17.4
Exception Handlers
17.5
Interrupt Service Routine Context Switching
17.6
Latency
17.7
Enabling/Disabling Interrupts
17.8
ISR Considerations
18
Main, Runtime Start-up and Reset
18.1
The Main Function
18.2
Runtime Start-up Code
19
Libraries
19.1
Smart IO Routines
19.2
User-defined Libraries
19.3
Using Library Routines
20
Mixing C/C++ and Assembly Language
20.1
Mixing Assembly Language and C Variables and Functions
20.2
Using Inline Assembly Language
20.3
Predefined Macro
21
Optimizations
21.1
Optimization Feature Summary
22
Preprocessing
22.1
Preprocessor Directives
22.2
C/C++ Language Comments
22.3
Pragma Directives
22.4
Predefined Macros
23
Linking Programs
23.1
Replacing Library Symbols
23.2
Linker-Defined Symbols
24
Implementation-Defined Behavior
24.1
Overview
24.2
Translation
24.3
Environment
24.4
Identifiers
24.5
Characters
24.6
Integers
24.7
Floating-Point
24.8
Arrays and Pointers
24.9
Hints
24.10
Structures, Unions, Enumerations, and Bit Fields
24.11
Qualifiers
24.12
Declarators
24.13
Statements
24.14
Pre-Processing Directives
24.15
Library Functions
24.16
Architecture
25
C++ Implementation-Defined Behavior
26
Built-in Functions
26.1
Built-in Function Descriptions
27
ASCII Character Set
28
Document Revision History
The Microchip Website
Product Change Notification Service
Customer Support
Product Identification System
Microchip Devices Code Protection Feature
Legal Notice
Trademarks
Quality Management System
Worldwide Sales and Service