Вы находитесь на странице: 1из 25

PC-Lint Visual Studio 2005

: : 05.12.2006

++ .

PC-Lint

8.0.

++ . , . , . , TestComplete (http://www.automatedqa.com)

, .

. , AutomatedQA Parasoft Jtest (http://www.parasoft.com). .

, . . Testing Relief (http://www.testingrelief.net). .

Valgrind (http://valgrind.org), Compuware BoundsChecker (http://www.compuware.com).

, , . , , Coverity Incorporated (http://www.coverity.com) Gimpel Software PC-Lint (http://www.gimpel.com), . Viva64 (http://www.viva64.com), 64.

GimpelSoftware PC-Lint 8.0. . .

1.

PC-Lint
PC-lint . , . PC-lint , . ,

1.

2.

3.

4.

5. PC-lint,

. , . , . C.

, ,

6.

7. .

8. .

9. PC-lint PC-lint Visual Studio 2005 Visual Studio 2005. Visual Studio 2003, . ,

, Visual Studio. env-vc7.lnt.

2.

10. . , .

, , . . . PC -lint, ,

11. , 2003. "STD.LNT". Visual C++ 2005,

. Visual C++

12.

13.

, .

MFC, STL Win32API,

: "C:\Lint". "C:\Lint\lnt" PATH.

LNT ,

"C:\Lint\lnt" .

14. , , (

, ) .

15. ( . , Mesa),

16. , "unknown.h".

. PC-lint #include

17.

18. .

, , "No".

19. lint. , "options.lnt".

PC -

, :

if ( (a = b) ) { ... }

. . vc7.lnt" , . .

21.

"e vvc7.lnt" "env -

20

22. .

PC-lint

23. Visual Studio 2005. , PC-lint

http://www.gimpel.com . http://www.viva64.com/go.php?url=501. "co-msc80.lnt", . Visual Studio 2005. 10).

8.00,

"C:\Lint" (

. . , "options.lnt". // Please note -- this is a representative set of error suppression // options. Please adjust to suit your own policies // See manual (chapter LIVING WITH LINT) // for further details. -e820 // allow test of parenthesized assignment ( 15). , : . PC-lint. : "options.lnt" "std.lnt".

if ( (a = b) ) { ... }

? -e820 // allow test of parenthesized assignment

"options.lnt",

. "options.lnt" PC-lint , "std.lnt". , "std.lnt": // Microsoft Visual C++ .NET 2003, // -si4 -sl4 -sp8, lib-mfc.lnt lib-stl.lnt lib-w32.lnt // Standard lint options co-msc71.lnt "#include" / ++.

lib-mfc.lnt lib-stl.lnt lib-w32.lnt options.lnt -si4 -sl4 -sp8 -iD:\ASRC\fox-lib\fox-1.4.4\include -iD:\ASRC\Libraries\mesa\include "co-msc71.lnt" ( #include Visual C++ 2003. / ++) "co-msc80.lnt". . "env-vc8.lnt", PC-Lint , , Visual Studio. ( "std.lnt"), "options.lnt -si4 -sl4 -sp8" . . , PC-lint. . / , , , "std.lnt". , . "options.lnt", . , , , "env-vc7.lnt" "env-vc7.lnt" . "env-vc8.lnt", Visual Studio, , "std.lnt" "options.lnt". MSVC. "std.lnt" PC-lint.

"lib-mfc.lnt lib-stl.lnt lib-w32.lnt" "env-vc7.lnt". .

, "std.lnt" -iD:\ASRC\fox-lib\fox-1.4.4\include -iD:\ASRC\Libraries\mesa\include co-msc80.lnt env-vc7.lnt lib-mfc.lnt lib-stl.lnt lib-w32.lnt -si4 -sl4 -sp8 -w3 -e820 :

-w##.

PC -lint

MSVC.

Tools: Project Cre tion Project Chec Unit Chec -

. .

25.

"External Tools ..."

Tools.

PC-lint

24.

3.

  

Visual Studio 2005

Visu l Stu io 2005.

PC-lint.

PC-lint ( .

MSVC. );

"Simple Chec "

26.

"Add".

27.

28. "Tools".

OK.

"PC-lint (Project Creation)"

29. Check". ). ,

"Project Creation" (

"Project

30. .

"Unit Check".

31. .

, PC-lint Visual Studio , PC-lint (Project Check).

"Tools" . PC-lint

(Project Creation),

PC-lint (Project Creation) . PC-lint (Unit Chec )

32. .

33.

Win32

. , PC-lint (Project Creation).

. PC -lint (Unit Chec )

34. . ,

, , (/W4).

"Finish".

#include "stdafx.h" TCHAR FooTxt[] = _T("foo"); bool Foo(int argc, _TCHAR* argv[]) { for (int i = 0; i != argc; ++i) { if (_tcscmp(argv[i], FooTxt) == 0) { return true; } } return false; } int _tmain(int argc, _TCHAR* argv[]) { if (Foo(argc, argv)) return 1;

return 0; }

PC-lint. "PC-lint (Project Check)". : ,

"PC-lint (Project Creation)",

PC-lint for C/C++ (NT) Vers. 8.00u, Copyright Gimpel Software 1985-2006 --- Module: .\SimpleProjectForPClint.cpp (C++) } .\SimpleProjectForPClint.cpp(14): error 818: (Info -- Pointer parameter 'argv' (line 5) could be declared as pointing to const) .\SimpleProjectForPClint.cpp(5): error 830: (Info -- Location cited in prior message) --- Module: .\stdafx.cpp (C++) --- Wrap-up for Module: .\stdafx.cpp .\stdafx.cpp(9): error 766: (Info -- Header file 'D:\WORK3\SimpleProjectForPClint\SimpleProjectForPClint\stdafx.h' not used in module '.\stdafx.cpp') --- Global Wrap-up .\SimpleProjectForPClint.cpp(5): error 765: (Info -- external 'Foo(int, unsigned short **)' (line 5, file .\SimpleProjectForPClint.cpp) could be made static) .\SimpleProjectForPClint.cpp(3): error 765: (Info -- external 'FooTxt' (line 3, file .\SimpleProjectForPClint.cpp) could be made static) D:\WORK3\SimpleProjectForPClint\SimpleProjectForPClint\stdafx.h(9): error 755: (Info -- global macro 'WIN32_LEAN_AND_MEAN' (line 9, file D:\WORK3\SimpleProjectForPClint\SimpleProjectForPClint\stdafx.h) not referenced) error 900: (Note -- Successful completion, 6 messages produced) . , : PC-lint for C/C++ (NT) Vers. 8.00u, Copyright Gimpel Software 1985-2006 --- Module: .\pclint.cpp (C++) _ #include <stdio.h> D:\Sources\pclint\stdafx.h(10) : Error 322: Unable to open include file , .

'stdio.h' , INCLUDE, echo %INCLUDE% : C:\Program Files\Microsoft Visual Studio 8\VC\ TLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;7 Visual Studio , , PC -lint. ,

35. PC-lint.

F4

Output,

PC-lint 8.00

1. Wikipedia, "Unit testing", http://www.viva64.com/go.php?url=44

Visual Studio 2005 .

2. 3. 4. 5. 6.

Wikipedia, "Dynamic testing", http://www.viva64.com/go.php?url=45 Wikipedia, "Static testing", http://www.viva64.com/go.php?url=46 Wikipedia, "Static code analysis", http://www.viva64.com/go.php?url=31 Wikipedia, "White box testing", http://www.viva64.com/go.php?url=47 Wikipedia, "Black box testing", http://www.viva64.com/go.php?url=48

Вам также может понравиться