PC-Lint Plus für C/C++

Statische Analyse von C/C++ Quellcode

Hersteller: Gimpel Software

Aktuelle Version: 1.1 / Betriebssysteme: Windows 7/8/10 (32-/64-bit), Linux (64-bit) und MacOS.

PC-Lint Plus MISRA Standards Checking

The Motor Industry Software Reliability Association (MISRA) is an organization that produces and maintains C and C++ programming guidelines. The primary purpose of these guidelines is to codify a set of recommendations related to software development that aids in the creation of "safe and reliable software". While MISRA is an effort born out of the automotive industry, MISRA’s success has grown and the guidelines have been adopted to meet needs in other safety-critical industries such as healthcare and aerospace.

MISRA has produced three versions of their guidelines for C, each one replacing the previous version. The versions are MISRA C 1998 (sometimes referred to as MISRA C1), MISRA C 2004 (aka MISRA C2) and MISRA C 2012 (aka MISRA C3). In 2008, MISRA released guidelines for C++ (MISRA C++). While the MISRA C++ effort is currently defunct (there is no active work in this area), the guidelines are employed by some organizations seeking MISRA style guidelines for C++.

Each MISRA guidelines document consists of a series of numbered advisory, required, and mandatory "rules" and "directives". A directive is more generalized (such as requiring that "run-time failures be minimized") while Rules are concrete and testable (such as forbidding the use of C++ style comments). Directives are often not statically checkable while Rules often are.

PC-lint Plus provides support for the MISRA C2, MISRA C3, and MISRA C++ guidelines. This support is achieved through a combination of standard PC-lint Plus messages and elective notes dedicated to specific MISRA rules. Gimpel Software provides the author files au-misra2.lnt, au-misra3.lnt, and au-misra-cpp.lnt to enable the checks necessary to support these guidelines. These author files also include -append options, which cause messages that are used to report on MISRA violations to be annotated with the corresponding Rule or Directive number(s).

While some of the messages are very specific to MISRA guidelines (such as those involving interactions amongst "essential types", a MISRA creation), any of the messages may be employed individually for those desiring to make use of a subset of the checks, outside of MISRA compliance checking.

The author files enable checks for both library and non-library code. This means that the standard headers employed by your source code are subject to the same scrutiny as the rest of the project. This is often a requirement but can result in a lot of noise if library code is not subject to the same compliance requirements as the rest of the project. The simplest way to disable MISRA checks for library code is to place the options -wlib(4) -wlib(1) immediately after the author file is referenced. This raises and immediately lowers the warning level for libraries resulting in a suppression of all non-error messages from library code. Any non-error messages that you intend to enable for library code (e.g. via +elib) should appear after these options.

The following subsections document the level of support provided by PC-lint Plus for each of the directives and rules supported. For each rule, the rule number, and primary enforcing messages are provided. The letter in parenthesis after each rule indicates whether the rule is advisory (A), required (R), or mandatory (M). An asterisk beside this letter indicates that MISRA has deemed the rule to be "undecidable", that is not possible to be fully checked by static analysis methods. In such cases PC-lint Plus provides the level of support feasible. While every effort is made to ensure the correctness of the information provided here, the author files should be considered the ultimate source of enforcement information.

Supported MISRA C 2012 Directives

DirectiveMessage
4.4 (A*)602
4.5 (A*)9046
4.6 (A*)970
4.7 (R*)534
4.8 (A*)9045
4.9 (A*)9026
4.10 (R*)451
4.11 (R*)418 419 420 422 668 669 670 671 2423 2623
4.12 (R*)586

Supported MISRA C 2012 Rules

RuleMessage
1.3 (R*) 9020 9023
2.1 (R*) 506 527 681 827
2.2 (R*) 438 505 520 521 522
2.3 (A) 751 756
2.4 (A) 753 9058
2.5 (A) 750 755
2.6 (A) 563
2.7 (A) 715
3.1 (R) 602 9059 9066 9259
4.1 (R) 9039
4.2 (A) 584 739 9060
5.3 (R) 578
5.5 (R) 9095 9096
6.1 (R) 9149
6.2 (R) 9088
7.1 (R) 9001
7.2 (R) 9048
7.3 (R) 620 9057
7.4 (R) 489 1776 1778
8.1 (R) 601 808
8.2 (R) 936 937 955
8.3 (R) 9072 9073 9094
8.4 (R) 957 9075
8.5 (R) 9004
8.7 (A) 765
8.8 (R) 839
8.9 (A) 9003
8.11 (A) 9067
8.12 (R) 488
8.13 (A*) 818 844 954
8.14 (R) 586
9.1 (M*) 530 644
9.3 (R) 9068
9.4 (R) 485
9.5 (R) 9054
10.1 (R) 9027
10.2 (R) 9028
10.3 (R) 9034
10.4 (R) 9029
10.5 (A) 9030
10.6 (R) 9031
10.7 (R) 9032
10.8 (R) 9033
11.1 (R) 9074
11.2 (R*) 9076
11.3 (R) 9087
11.4 (A) 9078
11.5 (A) 9079
11.7 (R) 4342 4343
11.8 (R) 9005
11.9 (R) 9080
12.1 (A) 9050
12.2 (R*) 9053
12.3 (A) 9008
12.4 (A) 648
13.1 (R*) 446
13.2 (R*) 564 931
13.3 (A) 9049
13.4 (A) 720 820 9084
13.5 (R*) 9007
13.6 (M) 9006 9089
14.1 (R*) 9009
14.3 (R) 650 685 774
14.4 (R) 9036
15.1 (A) 801
15.2 (R) 9064
15.3 (R) 9041
15.4 (A) 9011
15.5 (A) 904
15.6 (R) 9012
15.7 (R) 9013 9063
16.1 (R) 9014 9042 9077 9081 9082 9085
16.2 (R) 9055
16.3 (R) 9077 9090
16.4 (R) 9014 9085
16.5 (R) 9082
16.6 (R) 9081
16.7 (R) 483
17.1 (R) 829
17.2 (R*) 9070
17.3 (M) 718
17.4 (M) 533
17.6 (M) 9043
17.7 (R) 534
17.8 (A*) 9044
18.1 (R*) 415 416 428 661 662 676
18.2 (R*) 947
18.3 (R*) 946
18.4 (A) 9016
18.5 (A) 9025
18.6 (R*) 733 789 604
18.7 (R) 9038
18.8 (R) 9035
19.2 (A) 9018
20.1 (A) 9019
20.2 (R) 9020
20.3 (R) 12 544
20.4 (R) 9051
20.5 (A) 9021
20.6 (R) 436
20.7 (R) 665
20.8 (R) 9037
20.9 (R) 553
20.10 (A) 9024
20.11 (R) 484
20.13 (R) 16 544 9160
20.14 (R) 8
21.1 (R) 9071 9083
21.2 (R) 683
21.3 (R) 586
21.4 (R) 586 829
21.5 (R) 586 829
21.6 (R) 586
21.7 (R) 586
21.8 (R) 586
21.9 (R) 586
21.10 (R) 586 829
21.11 (R) 829
21.12 (A) 586
22.1 (R*) 429
22.2 (M*) 424 449
22.5 (M*) 9047

Supported MISRA C++ 2008 Rules

RuleMessage
0-1-1 (R) 506 527 681 685 774 827 944
0-1-2 (R) 685 774 827 944
0-1-3 (R) 528 529 714 752 757 1715
0-1-4 (R) 528 529 550 551 552
0-1-5 (R) 751 753 756 758
0-1-6 (R) 438 838
0-1-7 (R) 534
0-1-8 (R) 9175
0-1-9 (R) 438 587 685 774 838 944 948
0-1-10 (R) 528 714 1714 1914
0-1-11 (R) 715
0-1-12 (R) 715
0-3-2 (R) 534
2-3-1 (R) 584 739
2-5-1 (A) 9102
2-7-1 (R) 602
2-10-1 (R) 9046
2-10-2 (R) 578 1411 1511 1516
2-10-5 (A) 9103
2-10-6 (R) 18
2-13-1 (R) 606
2-13-2 (R) 9104
2-13-3 (R) 9105
2-13-4 (R) 9106
2-13-5 (R) 707
3-1-1 (R) 9107
3-1-2 (R) 9108
3-1-3 (R) 9067
3-2-1 (R) 18 31
3-2-2 (R) 15 31
3-2-3 (R) 9004
3-2-4 (R) 15 31
3-3-1 (R) 759 765
3-3-2 (R) 401 839
3-9-1 (R) 9073 9094 9168
3-9-2 (A) 970
3-9-3 (R) 9110
4-5-1 (R) 9111
4-5-3 (R) 9112
4-10-2 (R) 910
5-0-1 (R) 564
5-0-2 (A) 9113
5-0-3 (R) 9114 9116
5-0-4 (R) 9117
5-0-5 (R) 9115 9118
5-0-6 (R) 9119 9120
5-0-7 (R) 9121 9122
5-0-8 (R) 9123 9124
5-0-9 (R) 9125
5-0-10 (R) 9126
5-0-11 (R) 9128
5-0-13 (R) 909
5-0-14 (R) 909
5-0-15 (R) 947 9016
5-0-16 (R) 415 416 661 662
5-0-17 (R) 947
5-0-18 (R) 946
5-0-19 (R) 9025
5-0-20 (R) 9172
5-0-21 (R) 9130
5-2-1 (R) 9131
5-2-2 (R) 1774 1939
5-2-3 (A) 9171
5-2-4 (R) 1924
5-2-5 (R) 9005
5-2-6 (R) 611
5-2-7 (R) 916 920 923 926 927 928 929 930 9176
5-2-8 (A) 923 925 930
5-2-9 (A) 9091
5-2-10 (A) 9049
5-2-11 (R) 1753
5-2-12 (R) 9132
5-3-1 (R) 9133
5-3-2 (R) 9134
5-3-3 (R) 9135
5-3-4 (R) 9006
5-8-1 (R) 9136
5-14-1 (R) 9007
5-18-1 (R) 9008
5-19-1 (A) 648
6-2-1 (R) 720 820 9084
6-2-2 (R) 9137
6-2-3 (R) 9138
6-3-1 (R) 9012
6-4-1 (R) 9012
6-4-2 (R) 9013
6-4-3 (R) 9042
6-4-4 (R) 9055
6-4-5 (R) 9090
6-4-6 (R) 744 9139
6-4-7 (R) 483
6-4-8 (R) 764
6-5-3 (R) 850
6-6-1 (R) 9041
6-6-2 (R) 107 9064
6-6-3 (R) 9254
6-6-4 (R) 9011
6-6-5 (R) 904
7-1-1 (R) 952
7-1-2 (R) 818
7-3-1 (R) 9141 9162
7-3-2 (R) 9142
7-3-3 (R) 1751
7-3-4 (R) 9144
7-3-6 (R) 9145
7-4-2 (R) 522
7-5-1 (R) 604
7-5-2 (R) 789
7-5-3 (R) 1780 1940
7-5-4 (A) 9070
8-0-1 (R) 9146
8-3-1 (R) 1735
8-4-1 (R) 9165
8-4-2 (R) 9072 9272
8-4-3 (R) 533
8-4-4 (R) 9147
8-5-1 (R) 530
8-5-2 (R) 940
8-5-3 (R) 9148
9-3-1 (R) 605 1536
9-3-2 (R) 1536
9-3-3 (R) 1762
9-5-1 (R) 9018
9-6-2 (R) 9149
9-6-3 (R) 9149
9-6-4 (R) 9088
10-1-1 (A) 9174
10-1-3 (R) 1748
10-3-2 (R) 1909
10-3-3 (R) 9170
11-0-1 (R) 9150
12-1-1 (R) 1506
12-1-2 (A) 1928
12-1-3 (R) 9169
12-8-1 (R) 1938
12-8-2 (R) 9151
14-5-2 (R) 1789
14-5-3 (R) 1721
14-7-1 (R) 1795
14-7-3 (R) 1576 1577
14-8-2 (A) 9153
15-0-2 (A) 9154
15-0-3 (R) 646
15-1-2 (R) 1419
15-1-3 (R) 9156
15-3-1 (R) 1546
15-3-4 (R) 1560
15-3-5 (R) 1752
15-3-7 (R) 1127
15-4-1 (R) 1548
15-5-1 (R) 1546
15-5-2 (R) 1549
15-5-3 (R) 1546
16-0-1 (R) 9019
16-0-2 (R) 9158 9159
16-0-3 (R) 9021
16-0-4 (R) 9026
16-0-5 (R) 436
16-0-6 (R) 9022
16-0-7 (R) 553
16-0-8 (R) 16 544 9160
16-1-1 (R) 491
16-1-2 (R) 8
16-2-3 (R) 967
16-2-4 (R) 9020
16-2-5 (A) 9020
16-2-6 (R) 12
16-3-1 (R) 9023
16-3-2 (A) 9024
17-0-1 (R) 9052
17-0-2 (R) 9071 9093
17-0-5 (R) 586
18-0-1 (R) 829
18-0-2 (R) 586
18-0-3 (R) 586
18-0-4 (R) 829
18-0-5 (R) 586
18-2-1 (R) 586
18-4-1 (R) 586 9173
18-7-1 (R) 829
19-3-1 (R) 586
27-0-1 (R) 829

Supported MISRA C 2004 Rules

RuleMessage
1.2 (R) many
2.1 (R) 586
2.2 (R) 9260
2.3 (R) 602
2.4 (A) 602
3.4 (R) 975
4.1 (R) 606 2406 9104 9204
4.2 (R) 584 739
5.2 (R) 578
6.1 (R) 9128 9209
6.2 (R) 9128
6.3 (A) 970
6.4 (R) 9212
6.5 (R) 9088 9288
7.1 (R) 9001 9104
8.1 (R) 718 746 937 957
8.2 (R) 601 808
8.3 (R) 9073 9094
8.4 (R) 15 18 64
8.5 (R) 9107
8.6 (R) 9108
8.7 (R) 9003
8.8 (R) 9004
8.10 (R) 765
8.11 (R) 401 839
8.12 (R) 9067
9.1 (R) 530 644
9.2 (R) 576 940 9068
9.3 (R) 9148
10.1 (R) 9225 9226
10.2 (R) 9227 9228
10.3 (R) 9229
10.4 (R) 9230
10.5 (R) 9231
10.6 (R) 9048
11.1 (R) 4342 4343 9237
11.2 (R) 4342 4343
11.3 (A) 923
11.4 (A) 9087 9287
11.5 (R) 9005
12.1 (A) 9050
12.2 (R) 564
12.3 (R) 9006 9089
12.4 (R) 9007
12.5 (R) 9240
12.6 (A) 9232
12.7 (R) 9233
12.8 (R) 9234
12.9 (R) 9235
12.10 (R) 9008
12.11 (A) 648
12.12 (R) 9110
12.13 (A) 9049
13.1 (R) 720 9236
13.2 (A) 9224
13.3 (R) 777 9252
13.4 (R) 9009
13.5 (R) 440 443
13.6 (R) 850
13.7 (R) 506, 650 685 774 845
14.1 (R) 527 681 827
14.2 (R) 505 522
14.3 (R) 9138
14.4 (R) 801
14.5 (R) 9254
14.6 (R) 9011
14.7 (R) 904
14.8 (R) 9012
14.9 (R) 9012
14.10 (R) 9013 9063
15.0 (R) 9042
15.1 (R) 44 9055
15.2 (R) 9090
15.3 (R) 9014 9139
15.4 (R) 9238
15.5 (R) 764
16.1 (R) 9165
16.2 (R) 9070
16.3 (R) 955
16.4 (R) 9072
16.5 (R) 937
16.6 (R) 118 119
16.7 (A) 818
16.8 (R) 533
16.9 (R) 9147
16.10 (R) 534
17.4 (R) 9016, 9017 9264
17.5 (A) 9025
17.6 (R) 604 733 789
18.1 (R) 115
18.4 (R) 9018
19.1 (A) 9019
19.2 (A) 9020
19.3 (R) 12
19.5 (R) 9158 9159
19.6 (R) 9021
19.7 (A) 9026
19.8 (R) 131
19.9 (R) 436
19.10 (R) 9022
19.11 (R) 553
19.12 (R) 9023
19.13 (A) 9024
19.14 (R) 491
19.15 (R) 451
19.16 (R) 16 544 9160
19.17 (R) 8
20.1 (R) 980 9071 9083
20.2 (R) 9093
20.4 (R) 586
20.5 (R) 586
20.6 (R) 586
20.7 (R) 586
20.8 (R) 586 829
20.9 (R) 829
20.10 (R) 586
20.11 (R) 586
20.12 (R) 586
Visual Lint

PC-Lint Plus ist ein reines Kommandozeilentool.
Das Add-On Visual Lint bietet eine komfortable grafische Bedieneroberfläche, sowie eine Integration in Visual Studio und Eclipse für PC-Lint Plus.