- 279
- 0
- 约2.21万字
- 约 17页
- 2017-06-21 发布于河南
- 举报
pclint测试c或c实例
PC-lint测试C/C++实例
实例1:test.cpp
1 #include string.h
2 class X
3 {
4 int *p;
5 public:
6 X()
7 { p = new int[20]; }
8 void init()
9 { memset( p, 20, a ); }
10 ~X()
11 { delete p; }
12 };
编译这个文件,VC6.0产生0 errors 0 warnings, 而lint程序产生了如下8条警告信息,有些还是很有用处的提示。
PC-lint 告警信息:
test.cpp(12): error 783: (Info -- Line does not end with new-line)
test.cpp(7): error 1732: (Info -- new in constructor for class X which has no assignment operator)
test.cpp(7): error 1733: (Info -- new in constructor for class X which has no copy constructor)
{ memset( p, 20, a ); }
test.cpp(9): error 669: (Warning --
您可能关注的文档
最近下载
- 2025年全国高考(新课标)物理真题卷含答案解析.docx VIP
- 2025全国高中数学联赛河南预赛试题及答案(高一).doc VIP
- 2025年人教版五年级下学期语文期中考试测试卷01.pdf VIP
- 工期进度计划及保证措施.docx VIP
- 2016高考全国新课标3卷物理含答案解析.doc VIP
- 民法典侵权责任编.ppt VIP
- 太阳能车棚设计.doc VIP
- 光学玻璃性能手册.pdf
- AP宏观经济学 2018年真题 (选择题+问答题) AP Macroeconomics 2018 Released Exam and Answers (MCQ+FRQ).pdf VIP
- 《系统工程 第6版》 课件全套 汪应洛 第1--8章 系统工程概述--- 系统工程应用实例.pptx
原创力文档

文档评论(0)