Introduction
The Gimpel PC-lint/Motor Industry Software Reliability Association (MISRA) plugin provides a Language Interpreter (LINT) and MISRA standard check on C source files created in MPLAB® X IDE. This plugin has various settings, which include PC-lint installation path, compiler configuration, command-line argument, log file creation, and selection of source files.
PC-lint will check your C/C++ source code and find bugs, glitches, inconsistencies, non-portable constructs, redundant code, and much more using the Kernighan & Ritchie (K&R) and American National Standards Institute (ANSI) standards for C (style of coding). The purpose of linting your program is to determine potential problems prior to integration or porting or to reveal unusual constructs that may be a source of subtle errors. The C compiler cannot always detect each and every potential problem in your source files; this is where PC-lint comes in. PC-lint can be configured to suit your needs, it can either complain a lot or a little.
To check the source code, the plugin will invoke the Gimpel PC-lint/MISRA executable file with the appropriate command-line argument. The output of the Gimpel PC-lint/MISRA analysis will be redirected to the MPLAB X IDE Output window. 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.
For instructions on how to install PC-lint and the Microchip plugin for PC-lint visit the "PC-lint Installation" page. We have also provided an example for how to use the Gimpel PC-lint/MISRA plugin.