12 Document Revision History

Revision A (March 2018)

  • 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