24.2 Using the CCI

The CCI allows enhanced portability by refining implementation-defined behavior and standardizing the syntax for extensions to the language.

The CCI is something you choose to follow and put into effect, thus it is relevant for new projects, although you can choose to modify existing projects so they conform.

For your project to conform to the CCI, you must do the following things.

  • Enable the CCI

    Select the MPLAB X IDE widget Use CCI Syntax in your project, or use the command-line option that is equivalent.

  • Include <xc.h> in every module

    Some CCI features are only enabled if this header is seen by the compiler.

  • Ensure C Language Standard compliance

    Code that does not conform to the C Language Standard does not conform to the CCI.

  • Observe refinements to the Language Standard by the CCI

    Some implementation-defined behavior is defined explicitly by the CCI.

  • Use the CCI extensions to the language

    Use the CCI extensions rather than the native language extensions.

The next sections detail specific items associated with the CCI. These items are segregated into those that refine the standard, those that deal with the C Language Standard extensions, and other miscellaneous compiler options and usage. Guidelines are indicated with these items.

If any implementation-defined behavior or any non-standard extension is not discussed in this document, then it is not part of the CCI. For example, GCC case ranges, label addresses and 24-bit short long types are not part of the CCI. Programs which use these features do not conform to the CCI. The compiler may issue a warning or error to indicate a non-CCI feature has been used and the CCI is enabled.