Keil Logo

Configure PC-lint

This section shows the configuration of PC-Lint for validation and MISRA checking.

General setup

Open Tools – Set-up PC-lint and enter the path to the PC-lint executable. It is recommended to enable Add Compiler Conifg, as the relevant PC-lint configuration files are automatically selected.

You may include other project information as shown below. For details refer to Setup PC-lint.

picture: PC-lint config

Setup for MISRA Validation

MISRA validation can be set separately for C and C++ modules. Select the corresponding tab and choose the relevant Rules configuration, for example MISRA_C_2012_Config. Then click on Setup to copy the rules configuration file to your project.

picture: MISRA config

Click on Edit to configure the MISRA rules. This opens the configuration file where you may disable certain MISRA rules.

picture: MISRA config file edit

Additional PC-lint Commands

You may enter Additional Lint Commands that are added to the PC-Lint configuration.

  • Single File allows you to specify commands when only one file is validated.
  • Multiple Files allows you to specify commands when a file group or the complete project is validated.

For example, to suppress the info 714 message from the PC-lint output, you may enter –e714 into this dialog.

picture: Exclude message

For complex PC-lint setups, you may use additional PC-lint configuration files, using the command –ifilename.lnt.

Additional Information

The folder ..\UV4\Lint contains the PC-lint template setup files.

Compiler PC-lint Setup Files
File name Description
co-ARMCC-5.lnt Setup file for ARMCC5
co-ARMCC-6.lnt Setup file for ARMCC6
co-kc51.lnt Setup file for C51
co-kc251.lnt Setup file for C251
co-kc166.lnt Setup file for C166
MISRA Template Configuration Files
File name Description
MISRA_C_2012_Config.lnt Config file for MISRA-C 2012
MISRA_C_2004_Config.lnt Config file for MISRA-C 2004
MISRA_C_1998_Config.lnt Config file for MISRA-C 1998
MISRA_CPP_2008_Config.lnt Config file for MISRA-C++ 2008
MISRA Setup Files
File name Description
au-misra3.lnt Setup file for MISRA-C 2012
au-misra2.lnt Setup file for MISRA-C 2004
au-misra1.lnt Setup file for MISRA-C 1998
au-misra-cpp.lnt Setup file for MISRA-C++ 2008

During configuration with the PC-Lint Options dialog, the related MISRA configuration is copied to the project folder into the sub-folder .\Lint. The MISRA configuration is therefore only relevant for a single project, however, you may copy existing configuration files to other projects.

PC-Lint Command File Structure

The command files for PC-Lint are generated in the project folder and have the name target_F.lnt (for single file invocation) or target_A.lnt (for multi-file invocation). The PC-lint command file is generated based on the settings in the PC-lint Options dialog. An example is shown below:

Example content of single file target_F.lnt
// PC-Lint invocation file generated by uVision
// --------------------------------------------

// Lint specific command path:
-iC:\Keil_v5\UV4\Lint
-i.\Lint

// Compiler Include path:
-iC:\Keil_v5\ARM\ARMCC\include

// Project Include paths:
-i.\RTE\CMSIS
-i.\RTE\_Simulation

// Software Pack Include paths:
-iC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\Include
-iC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\RTOS2\Include
-iC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\RTOS2\RTX\Include
-iC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\Device\ARM\ARMCM3\Include

// Generated ARM Compiler Preprocessor Symbols:
-iFlash
+libh(co-arm_Simulation.h)
-header(co-arm_Simulation.h)

// ARM Compiler Lint configuration:
co-ARMCC-5.lnt

// MISRA Configuration file:
MISRA_C_2012_Config.lnt
// Disable messages for Compiler header file directories:
-wlib(4)
-wlib(1)
+libdir(C:\Keil_v5\ARM\ARMCC\include)

// Disable messages for Software Pack Include paths:
+libdir(C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\Include)
+libdir(C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\RTOS2\Include)
+libdir(C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\CMSIS\RTOS2\RTX\Include)
+libdir(C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1-dev5\Device\ARM\ARMCM3\Include)

// Additional Lint Commands:
-u
-e714

// Format Output to uVision:
-hsfb^3
-format="*** LINT: %(%f(%l) %)%t %n: %m"
-width(160,4)

// Source file(s) for verification:
Blinky.c
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.