Initial release of this document,
adapted from the MPLAB® XC8 C Compiler User’s Guide, DS 50002053.
Revision B (March 2019)
Clarified the operation of the
-mcodeoffset option when using devices with vectored
interrupts
Added information on the new code
coverage feature
Updated descriptions of the
compiler operating modes and the optimization level control,
-O
Added descriptions and screen
captures of the MPLAB X IDE project property dialogs corresponding to the
compiler command-line options
Updated information pertaining to
long long type support
Corrected typos and errors in
example code sequences
Clarified usage of the
__at() construct
Miscellaneous corrections and
improvements
Revision C (February 2020)
This guide has been migrated to a
new authoring and publication system; you may see differences in the formatting
compared to previous revisions
The documentation for the standard libraries has been updated
Added information on new
movff-related errata
Updated information reflecting
new behavior of assembler branch instruction transformations
Documented changes relating to
Hexmate's find (and replace) command syntax
Detailed changes that allow
object and p-code modules to co-exist inside library archives
Added SHA256 suboption to memory
summary option
Indicated that the
printf-family of functions can now be replaced by a
user-defined version
Added new assembler
CONFIG directive
Detailed changes relating to assembler controls, which now are treated like
directives
Expanded information on use of
the device family pack (DFP) option
Miscellaneous corrections and
improvements
Revision D (February 2021)
Added information on new stack guidance feature
Clarified positioning of
const-qualifed objects
Added information on the new Hexmate hash value options
Expanded the description of some existing Hexmate features
Added information relating to use of printf() in library
examples
Described the updated -x driver option
Added -mcmacros and -mclink driver
options
Updated screen captures of MPLAB X IDE project properties dialogs
Clarified use of case ranges inside switch statements
Added additional information relating to interrupts for PIC18 IVT devices
operating in legacy mode
Expanded description of status register preservation feature
Clarified use of the assembler DABS and DLABS
directive
Added new assembler WARN and DEBUG_SOURCE
directives
Revision E (August 2021)
Removed standard C library functions; these are now described in a separate
Microchip Universal Standard Library Reference Guide document
Added -fcacheconst option and description of new constant
caching feature
Added -mheap option and description of the heap and dynamic
memory allocation feature
Updated information relating to the operation of the -mstack
option.
Updated -mdebugger debugger option to reflect support for
generation 4 debugger tools
Updated screen captures of latest MPLAB X IDE Project Properties dialog relating
to Analysis options
Added information on new
BANKISEL directive
Added information on previously undocumented FILE and
LINE assembler directives
Added description of string support for the DB,
DW, and DDW assembler directives
Added updated information on
Hexmate's handling of INHX16 format HEX files
Added new O suboption to Hexmate's -CK option
which requests the final hash result be XORed with a the specified value
Revision F (May 2022)
Added
-msmart-io-format option, which indicates conversion
specifiers used when this is not obtainable from the source code
Added new
--fixupoverflow linker option that performs automatic
masking of assembly instruction operand values
Added -mdebugger option argument and
__MPLAB_ICE4__ preprocessor macro relating to selection of
the MPLAB ICE 4 debugger
Updated the Address Masking section to reflect the use of the
--fixupoverflow option
Option tables now have links to the corresponding section that describes
them
Adjusted description of how
quoted strings can be passed using the -D option, which has
changed in the compiler
Made mention of the Analysis Tools Suite license (which replaces the Code
Coverage license) required for the code coverage feature
Corrected the range of addresses accessible by mid-range mixed target space
pointers
Clarified that the compiler will
automatically mark as volatile any variables referenced in
interrupt routines
Updated text relating to compiler changes that affect when the
__CODECOV macro is defined
Expanded information on how to
access SFRs from assembly code
Expanded description of assembler
labels
Added description of
-c linker option to control the printed callgraph
Added description of entry ranges
associated with the -A linker option, applicable for Baseline
devices
Added missing section for the
PUBLIC directive
Updated --edf
linker/Hexmate option to reflect the new name used for message description
file
Mentioned that PIC18 pointers with mixed-space targets cannot be used to access
high-address memory areas, like the Device Information Area
Updated error and warning
messages to reflect new and changed messages produced by the
compiler/assembler
Revision G (December 2022)
Clarified how reentrant functions on PIC18 devices share the software stack
Reinstated text that described how the -Wl, option can be used
to replace default linker options
Added a C99 language divergence
relating to the floating-point type specification
Added notes to indicate that code
can fail when program memory has been read-protected though the configuration
bits
Updated screen captures of MPLAB X IDE project properties
Updated the diagram of internal compiler applications to reflect the demise of
the objtohex tool
Added text to describe how the software stack can be moved in memory
Added a new section on how to allocate objects to common data memory
Added a new section on absolute objects in external memory
Added STACK class to the list of default linker classes
Removed reference to the % assembly macro argument operator,
which is not usable
Clarified that 24-bit floating-point types are available only when building for
C90
Clarified that code can fail if
'buddy' functions that use the compiled stack call each other
Clarified how the __section() specified works with interrupt
functions
Clarified how non-zero
skipWidth values affects checksum
algorithms that process 16 or 32 bits of data per iteration
Clarified that persistent objects cannot be initialized
Removed out-of-date references to MCC-generated code that appeared in some
library function examples
Revision H (December 2023)
Added generation 5 debug tool selections, for tools such as MPLAB ICD 5, to the
-mdebugger option and to the list of predefined
macros
Added new
-Werror option, which promotes warnings into errors
Updated information relating to how case ranges are now handled by the
compiler
Added section on new compiler symbols that can be used to perform runtime stack
bounds checking
Clarified how interrupt functions in library archives are linked
Clarified that config pragmas should not be included in library
archives
Added new tips to the How Can I Make My Code Smaller? How To
Clarified that text-based psects
must be located on a 2-byte address boundary for PIC18 devices
Clarified that the program location counter cannot be used in
EQU assembly expressions
Removed information stating that the nul operator can be used
within an assembly macro
Corrected an example in the -A linker option
Added new xor suboption to the -mchecksum
option, which allows XORing of hash results
Added new or missing error and warning messages
Altered the description of messages 1604 and 1605 to indicate that the compiler
now treats these as advisories
General improvements to the descriptions of compiler features and options
Various updates to the Hexmate chapter, those being:
Added description of the Intel HEX file specification, as interpreted by
Hexmate
Discussed Intel HEX file formats used by Microchip tools
Updated and better presented allowable hash widths for all supported
algorithms
Added SHA-1 to list of support hash algorithms
Added new
--werror option, which promotes warnings to
errors
Added list of error and warning messages pertinent to Hexmate
Expanded Potential Causes of Failure section to include situations where
software breakpoints have been used
Corrected maximum record length allowable with the -format option
General improvements to the descriptions of Hexmate operations and
options
Revision J (October 2024)
Updated the How To, How Do
I Find The Names Used To Represent SFRs And Bits? to provide more
detailed information
Added smart-io feature to the
list of performed optimizations in the Optimizations section
Swapped examples to using the
recommended __asm() syntax of inline assembly rather than
asm()
Updated the
-save-temps option text to correctly indicate which
intermediate files remain after compilation
Removed
-fsigned-char and -funsigned-char options,
as these are not fully supported
Added new -W[no-]msg option, which can enable and disable
warning and advisory messages
Added information on the use of
variable argument lists with preprocessor macros
Provided an additional example of
the -p linker option to have multiple psects linked in a set
order but anywhere inside a linker class
Rewrote the sections on writing
interrupt code to describe the different strategies available, and added a
section on writing interrupt functions using the compiler's new Software
Interrupt Vector Table feature
Many changes relating to the
replacement of the legacy, HI-TECH-style C90 language (parsed by the now defunct
P1 application) with a more standard C90 language compliance (now parsed by the
Clang application)
Removed MPLAB® XC8 C Compiler Legacy User’s
Guide from recommended reading list
Removed information
relating to 24-bit floating-point types, which are no longer
relevant
Removed the sections and
references pertaining to the -fshort-double and
-fshort-float options
Updated information
relating to the available standard library names and locations
Removed the section
pertaining to the -mc90lib option, which is no longer
relevant
Clarified the usage of
the CCI with the C90 language standard
Removed the
no-longer-relevant C90 language divergence relating to function
declarations that used an empty function parameter list
Indicated that
long long types for PIC18 and Enhanced Mid-range
devices can now be 64 bits wide when using the C90 standard
Removed restriction
relating to _Bool type being unavailable with the C90
standard
Removed the restriction
stating that anonymous structures and unions cannot be initialized when
using the C90 standard
Indicated that
floating-point constants can be specified in hexadecimal format when
using the C90 standard
Indicated that the
position of the __at() construct can now be either
before or after the identifier in a definition when building to the C90
Standard
Indicated that dynamic
memory allocation is now available for PIC18 and Enhanced Mid-range
devices when building with the C90 standard
Indicated that all
preprocessor arithmetic is performed to 64 bit widths
Removed reference to the
HI_TECH_C preprocessor macro, and changed the 'when
set' information relating to the __CLANG__ macro
Indicated that case
ranges are no longer supported
Added the __STDC_VERSION__ preprocessor macro, which indicates
the C standard version
Added the
__OPTIM_LEVEL preprocessor macro and additional
optimization flag masks usable with preprocessor macros
Updated the storage format of
24-bit mixed target addresses used with PIC18 devices to reflect changes made to
the compiler
Corrected typos in the example
usage of the -msmart-io-format option
Updated and corrected examples of
in-line assemble to show the preferred way to access bits within SFR
registers
Added new
ERRORLEVEL assembler directive
Clarified the operation of the ORG directive when it is used in
a psect with multiple contributions in the same module
Updated the permitted reverse
word widths when calculating a hash using Hexmate
Added new error and warning messages
Miscellaneous corrections and improvements to the text
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.