




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1.安装PC-Lint安装和PC-Lint在Keil中配置见使用教程2.配置.lnt文件Keil安装路径ARMBINCO-RV.LNT添加:-w4 /生成所有信息-os(D:result.txt) /输出结果到文件result.txt3.PC-Lint代码检查功能PC-Lint能够检查出很多语法错误和语法上正确的逻辑错误,PC-Lint为大部分错误消息都分配了一个错误号,编号小于1000的错误号是分配给C 语言的,编号大于1000的错误号则用来说明C+的错误消息,见表1错误类型CC+告警级别语法错误1-1991001-11991内部错误200-2990致命错误300-3990告警400-6991400-16992消息700-8991700-18993可选信息900-9991900-19994表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温度校准程序 4.1FCA温度校准程序PC-Lint配置文件CO-RV.LNT4.2FCA温度校准程序Lint输出结果FCA_TempCalibration_result.txt4.3输出结果统计见表2、3、4,有6种语法、36种告警和41种消息错误常见错误如,40:变量未声明;91:行字符数超过600;506:固定的布尔值;525:缩排格式错误;527:无法执行到的语句;534:忽略函数返回值;616:在switch语句中未使用break;715:变量未引用;722:语句结束符“;”用在for()或者while()后面;734:赋值过程中精度丢失;错误类型PC-Lint错误编码计数PC-Lint告警信息语法错误10128Expecting a function142Symbol Symbol previously defined (Location)40128Undeclared identifier _promise46192field type should be _Bool, unsigned int or signed int9156Line exceeds 600 characters (use +linebuf)12324Macro min defined with arguments at line 表2错误类型PC-Lint错误编码计数PC-Lint告警信息告警4011symbol Symbol not previously declared static at Location4271/ comment terminates in 43814Last value assigned to variable Symbol not used4421for clause irregularity: testing direction inconsistent with increment direction4519repeatedly included but does not have a standard include guard4531Function Symbol, previously designated pure, String Name5022Expected unsigned type50615Constant value Boolean50868extern used with definition5141Unusual use of a Boolean5225Highest operator or function lacks side-effects52413Loss of precision (Context) (Type to Type)52523Negative indentation from Location5267Symbol (Location) not defined5271Unreachable code at token Symbol5291Symbol Symbol (Location) not subsequently referenced534268Ignoring return value of function Symbol (compare with Location)53736Repeated include file FileName5397Did not expect positive indentation from Location5451Suspicious use of & - An attempt was made to take the address of an array name.5502Symbol Symbol (Location) not accessed5527Symbol Symbol (Location) not accessed56941Loss of information (Context) (Integer bits to Integer bits)5732Signed-unsigned mix with divide5783Declaration of symbol Symbol hides symbol Symbol (Location)6111Suspicious cast61383Possible use of null pointer Symbol in left/right argument to operator String Reference6161control flows into case/default6287no argument information provided for function Symbol (Location)641110Converting enum to int6442Variable Symbol (Location) may not have been initialized6554bit-wise operation uses (compatible) enums66125possible access of out-of-bounds pointer (Integer beyond end of data) by operator String6621possible creation of out-of-bounds pointer (Integer beyond end of data) by operator String6681Possibly passing a null pointer to function Symbol, Context Reference6691Possible data overrun for function Symbol, argument Integer exceeds argument Integer Reference表3错误类型PC-Lint错误编码计数PC-Lint告警信息消息70133Shift left of signed quantity (int)7021Shift right of signed quantity (int)7051Argument no. Integer nominally inconsistent with format7081union initialization71321Loss of precision (Context) (Type to Type)71424Symbol Symbol (Location) not referenced71513Symbol Symbol (Location) not referenced71612while(1) .71712do . while(0)71812Symbol Symbol undeclared, assumed to return int72256Suspicious use of ;7253Expected positive indentation from Location7303Boolean argument to function7328Loss of sign (Context) (Type to Type)73420Loss of precision (Context) (Integer bits to Integer bits)7367Loss of precision (Context) (Integer bits to Integer bits)7374Loss of sign in promotion from Type to Type74014Unusual pointer cast (incompatible indirect types)7444switch statement has no default7467call to function Name not made in the presence of a prototype74715Significant prototype coercion (Context) Type to Type75014local macro Symbol (Location) not referenced7522local declarator Symbol (Location) not referenced7546local structure member Symbol (Location) not referenced7603Redundant macro Symbol defined identically at Location7624Redundantly declared symbol Symbol previously declared at Location765126external Symbol (Location) could be made static76611Header file FileName not used in module String7741Boolean within String always evaluates to True/False78513Too few initializers for aggregate Symbol81860Pointer parameter Symbol (Location) could be declared ptr to const8251control flows into case/default without -fallthrough comment8267Suspicious pointer-to-pointer conversion (area too small)8301227Location cited in prior message831221Reference cited in prior message8348Operator Name followed by operator Name is confusing. Use parentheses.83587A zero has been given as left/right argument to operator Name83817Previously assigned value to variable Symbol has not been used843117Variable Symbol (Location) could be declared as const8442Pointer variable Symbol (Location) could be declared as pointing to const84511The left/right argument to operator Name is certain to be 0表45.舵机程序5.1舵机程序PC-Lint配置文件co-iar80.lnt5.2舵机程序Lint输出结果STM8_SERVO_result.txt5.3输出结果见表5、6、7,有16种语法、10种告警和23种消息错误错误类型PC-Lint错误编码计数PC-Lint告警信息语法错误77Unable to open include file10126Expecting String1416Symbol Symbol previously defined (Location)1814Symbol Symbol redeclared (TypeDiff) conflicts with Location1923Useless Declaration3115Redefinition of symbol Symbol conflicts with Location361Redefining the storage class of symbol Symbol conflicts with Location4055Undeclared identifier Name4944Expected a type6313Expected an lvalue10121Expected an identifier102100Illegal parameter specification129154declaration expected, identifier Symbol ignored1326Expected function definition1615Repeated use of parameter Symbol in parameter list30914#error .表5错误类型PC-Lint错误编码计数PC-Lint告警信息告警5061Constant value Boolean5264Symbol (Location) not defined53315function Symbol should (not) return a value (see Location)5522Symbol Symbol (Location) not accessed57816Declaration of symbol Symbol hides symbol Symbol (Location)6011Expected a type for symbol Symbol, int assumed6284no argument information provided for function Symbol (Location)64118Converting enum to int6471Suspicious truncation6798Suspicious Truncation in arithmetic expression combining with pointer表6错误类型PC-Lint错误编码计数PC-Lint告警信息消息7043Shift right of signed quantity (long)7143Symbol Symbol (Location) not referenced71518Symbol Symbol (Location) not referenced7163while(1) .7184Symbol Symbol undeclared, assumed to return int7251Expected positive indentation from Location7322Loss of sign (Context) (Type to Type)7342Loss of precision (Context) (Integer bits to Integer bits)74515function Name has no explicit type or class, int assumed7465call to function Name not made in the presence of a prototype7471Significant prototype coercion (Context) Type to Type7502local macro Symbol (Location) not referenced7655external Symbol (Location) could be made static7661Header file FileName not used in module String7722Symbol Symbol (Location) conceivably not in
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 供热热源规划汇报
- 社工末期评估工作汇报
- 生管半年度工作总结
- 果洛市重点中学2026届英语九年级第一学期期末质量检测试题含解析
- 幼儿园轮状病毒培训
- 有效沟通培训心得
- 山东泰安2026届英语九年级第一学期期末复习检测试题含解析
- 2026届河北省承德市丰宁满族自治县九上化学期中质量检测模拟试题含解析
- 品质主管工作总结
- 内蒙古鄂尔多斯附属学校2026届九年级英语第一学期期末检测模拟试题含解析
- T/DZJN 118-2022废旧锂离子电池磷酸铁锂材料再生利用技术规范
- 艾灸治疗脾胃病的临床实践
- 资质代办合同协议书范本
- 2025年社区卫生服务岗位考试题及答案
- 古茗合同协议书
- 2025年电力机车钳工(高级)职业技能鉴定理论考试题库(含答案)
- 《蔚来汽车的SWOT分析》课件
- 智联招聘银行试题及答案
- 麻醉科职责及管理制度
- 血栓闭塞性脉管炎中免疫性血栓形成的分子机制研究
- 2025年艾滋病知识讲座
评论
0/150
提交评论