PC-Lint使用报告

1.安装 PC-Lint
安装和 PC-Lint 在 Keil 中配置见《使用教程》
2.配置 .lnt 文件
Keil 安装路径 \ARM\BIN\CO-RV.LNT 添加 : -w4 // 生成所有信息
-os(D:\) // 输出结果到文件
3.PC-Lint代码检查功能膜加盖
PC-Lint 能够检查出很多语法错误和语法上正确的逻辑错误,    PC-Lint 为大部分错误消息都分
配了一个错误号,编号小于 1000 的错误号是分配给 C 语言的,编号大于 1000 的错误号则 用来说明 C++的错误消息,见表 1
错误类型
C
C++
告警级别
语法错误
1-199
1001-1199
1
内部错误
200-299
0
致命错误
300-399
0
告警
400-699
电柜铰链
1400-1699
2
消息
700-899
1700-1899
3
可选信息
900-999
1900-1999
4
表1
以 C 语言为例:
机房集中监控
编号 1-199 指的是一般编译器也会产生的语法错误;
编号 200-299 是 PC-Lint 程序内部的错误,这类错误不会出现在代码中的;
编号 300-399 指的是由于内存限制等导致的系统致命错误;
编号 400-999 中出现的提示信息, 是根据隐藏代码问题的可能性进行分类的, 指的是被检查 代码中很可能存在问题而产生的告警信息;
编号 700-899 中出现的信息, 产生错误的可能性相比告警信息来说级别要低, 但仍然可能是 因为代码问题导致的问题;
编号 900-999 是可选信息,他们不会被默认检查,除非你在选项中指定检查他们。
PC-Lint告警级别分为以下几个级别,缺省告警级别为    3 级:
-
w0 不产生信息(除了遇到致命的错误)
-w1 只生成错误信息 -- 没有告警信息和其它提示信息
-w2 只有错误和告警信息
-w3 生成错误、告警和其它提示信息(这是默认设置)
-w4 生成所有信息
4.FCA温度校准程序


CO-RV.LNT
4.2FCA温度校准程序 Lint 输出结果《 FCA_t
FCA_
4.3输出结果统计见表 234,有 6种语法、 36种告警和 41种消息错误 常见错误如, 40:变量未声明; 91:行字符数超过 600 ;506:固定的布尔值; 525:缩排格 式错误;527:无法执行到的语句; 534:忽略函数返回值; 616:在 switch 语句中未使用 break ; 715:变量未引用; 722:语句结束符“ ;”用在 for()或者 while() 后面; 734:赋值过程中精度 丢失;
错误类型
PC-Lint 错误编码
计数
PC-Lint告警信息
语法错误
10
128
Expecting a function
14
2
Symbol 'Symbol' previously defined (Location)
40
128
冰雕模具
Undeclared identifier '__promise'
46
192
field type should be _Bool, unsigned int or signed int
91
56
Line exceeds 600 characters (use +linebuf)
123
24
Macro 'min' defined with arguments at line
表2
正二十面体的展开图
错误类型
PC-Lint 错误编码
计数
PC-Lint告警信息
401
1
symbol 'Symbol' not previously declared static at Location
427
1
// comment terminates in \
438
14
Last value assigned to variable 'Symbol' not used
442
1
for clause irregularity: testing direction inconsistent with increment direction
451
9
repeatedly included but does not have a standard include
guard
453
1
Function 'Symbol', previously designated pure, String 'Name'
502
2
Expected unsigned type
506
15
Constant value Boolean
508
68
extern used with definition
514
1
Unusual use of a Boolean
522
5
Highest operator or function lacks side-effects
524
13
Loss of precision (Context) (Type to Type)
525
23
固态发酵罐Negative indentation from Location
526
7
'Symbol' (Location) not defined
527
1
Unreachable code at token Symbol
529
1
Symbol 'Symbol' (Location) not subsequently referenced
告警
534
268
Ignoring return value of function 'Symbol' (compare with Location)
537
36
Repeated include file 'FileName'
539
7
Did not expect positive indentation from Location
545
1
Suspicious use of & -- An attempt was made to take the
address of an array name.
550
2
Symbol 'Symbol' (Location) not accessed
552
7
Symbol 'Symbol' (Location) not accessed
569
41
Loss of information (Context) (Integer bits to Integer bits)
573
2
Signed-unsigned mix with divide
578
3
Declaration of symbol 'Symbol' hides symbol 'Symbol' (Location)
611
1
Suspicious cast
613
83
Possible use of null pointer 'Symbol' in [left/right] argument to operator 'String' Reference
616
1
control flows into case/default
628
7
no argument information provided for function 'Symbol' (Location)
641
110
Converting enum to int
644
2
Variable 'Symbol' (Location) may not have been initialized
655
4
bit-wise operation uses (compatible) enum's

661
25
possible access of out-of-bounds pointer ('Integer' beyond end of data) by operator 'String'
662
1
possible creation of out-of-bounds pointer ('Integer' beyond end of data) by operator 'String'
668
1
Possibly passing a null pointer to function 'Symbol', Context Reference
669
1
Possible data overrun for function 'Symbol', argument Integer exceeds argument Integer Reference
表3

本文发布于:2024-09-22 09:44:15,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/2/282612.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:错误   代码   问题   级别
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议