pclint测试c或c++实例.docVIP

  • 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 --

文档评论(0)

1亿VIP精品文档

相关文档