Complete before executing PCLint.
Step-by-Step
1
Create a user option file, namedmyOptions.lnt, in the folderC:\lint, containing these instructions:
-i"C:\lint"
au-misra3.lnt
co-xc8.lnt
2
Inside MPLAB® X IDE, select the created user option file by navigating toTools > Options > Embedded > PCLint > Options > UserOptionFile.
3
Get theco-xc8.lnt file (modified 22Jul2015) from thethe Gimpel website.
| Files |
|---|
Before you start using this file, please perform these simple steps:
1) Include the path(s) to your header files.
- Run MPLAB XC8 to compile theempty.c file with -v option. Copy any -I argument from the output toinclude-path.lnt (in the same directory whereco-xc8.lnt exists).
- Don't forget to use the -i lint option. ex: -i"include-path".
- Note that any other include directories should be added explicitly.
2) Next, include the preprocessor macro definitions specific to the chip you are using.
- From the output you get in step one, copy all arguments starting with -D tolint-cmac.h in the same directory as co-xc8.lnt.
- Edit the file to have the form: #define macro_name value // each definition on a separate line
To do the above steps runxc8 —CHIP=16F1619 -v -v test.c > out.txt from the command prompt and then createlint-cmac.h andinclude-path.lnt.
These steps must be done every time the project configuration is changed.
4
Add the following two lines toco-xc8.lnt:
-header(lint-cmac.h) // preprocessor macro definitions
include-path.lnt
5
Click on the project, then click onLint this project.
Anytime anything in the project properties is changed (e.g., include path, change of device, compiler version, etc.), these steps must be repeated.

