To be able to use the MPLAB® X PC-lint plugin, you will need to install the Gimpel PC-lint Software. Go to the Gimpel website to acquire this product.
On Microsoft® Windows, running the setup program will copy the PC-lint files onto your hard drive. Running the configuration wizard (config.exe) will configure PC-lint (lint-nt.exe) for your compiler, libraries, editors, and IDEs. It may be run multiple times if you have multiple configurations for which you need support. It will build a batch file for calling PC-lint (lin.bat) and will invoke the appropriate PC-lint configuration files (*.lnt) for your environment. Note that PC-lint error messages may be found in the file msg.txt.
Some important Gimpel PC-lint/Motor Industry Software Reliability Association (MISRA) plugin files are listed below:
lin.bat
The batch file for invoking lint-nt.exe is lin.bat.
lint-nt.exe
The lint-nt.exe file is the PC-lint executable to process the C source file(s) for linting.
config.exe
The config.exe file is the configuration wizard for PC-lint. This wizard creates a file that contains options to allow PC-lint to process the source code, i.e., using this utility you will be able to select your desired Microchip C compiler.
co-xxxx.lnt
The co-xxxx.lnt files are included with PC-lint and contain options for using the respective MPLAB XC C compiler with PC-lint.
Currently, for PC-lint to support MPLAB XC C compilers, you will need to follow the instructions in the co-xc8.lnt, co-xc16.lnt, and co-xc32.lnt files for editing lint-cmac.h and include-path.lnt files.
The following is taken from co-xc8.lnt.
// Before you start using this file, please follow the directions to perform these
// simple steps:
// 1 - Include the path(s) to your header files
// - run xc8 with -v option and copy any -I argument from the output to
// include-path.lnt (in the same directory where co-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 - Now 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
// to "lint-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
msg.txt
The msg.txt file is an ASCII rendition of PC-lint messages for MPLAB X IDE use. PC-lint message types are shown in the following table:Type | C | C++ | Warning Level |
---|---|---|---|
Syntax Errors | 1 - 199 | 1001 - 1199 | 1 |
Internal Errors | 200 - 299 | 0 | |
Fatal Errors | 300 - 399 | 0 | |
Warnings | 400 - 699 | 1400 - 1699 | 2 |
Informational | 700 - 899 | 1700 - 1899 | 3 |
Elective Notes | 900 - 999 | 1900 - 1999 | 4 |
Installing the PC-lint Plugin on MPLAB X IDE
To install the plugin into MPLAB X IDE, follow the instructions in the "Installing Microchip Supplied Plugins" section of the "Plugins Window: Available Plugins Tab".