PC-lint Instructions For Use


The following step-by-step instructions will show you how to setup PC-lint for a project in MPLAB® X IDE. To start, make sure you have the following installed:

and the

For this specific example we are running a MISRA C 2012 (TM) check.



To be able to run a MISRA12 check, you need the following config-files:

  • au-misra3.lnt - MISRA checks to run
  • co-xc8.lnt - XC8 compiler config-files

Make sure you have the latest version of these configuration files. They can be obtained here.


Create an UserOption file that contains the following:

  • path to check-config-file = “au-misra3.lnt
  • path to compiler-config-file = “co-xc8.lnt
  • path to compiler header files

Below is an example of how it looks for this specific tutorial:

//  Microchip MPLAB XC8 C, -si4 -sp4, 
//  Standard lint options
// -SL-3.3.16: Based on input, setup this configuration
// C:\lint\options.lnt  -si4 -sp4
    -i"C:\Program Files (x86)\Microchip\xc8\v1.36\include"

As we can see from above, this option file includes the path to the lnt file that needs to be run for MISRA standard, path to the lnt file specific to XC8 compiler, and the path to include compiler header files.


Configure PC-lint in MPLAB X by going to “Tools —> Options —> Embedded —> PCLint”:

  • Location - path to your PC-lint installation “lint-nt.exe
  • Options - select UserOptionFile
  • User Option File - select the UserOption file you created in the previous step
  • Standards - MISRA2012


You also need to create 2 more config-files “include-path.lnt” and “lint-cmac.h” as described in the header of the “co-xc8.lnt” file.

Both files contain the information that is usually passed via compiler-options “-i xxx” in include-path.lnt and "-D xxx“ in lint-cmac.h.

See header of co-xc8.lnt for a more detailed explanation on how to create these two files.


Finally right-click on the project in the MPLAB X and select “Lint this Project



You will then see an output like the one below


The output will contain the file name(s) and line number(s) in which linting found inconsistencies. Double clicking an output line will open the corresponding file at the line number in the MPLAB X IDE editor window.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.