Skip to content

Instantly share code, notes, and snippets.

@hackallcode
Created December 8, 2017 07:00
Show Gist options
  • Save hackallcode/7988a2dbf50262561a62572ed65a82ab to your computer and use it in GitHub Desktop.
Save hackallcode/7988a2dbf50262561a62572ed65a82ab to your computer and use it in GitHub Desktop.
lab15

Laboratory work XV

Данная лабораторная работа посвещена изучению инструментов статического и динамического анализа кода

$ open http://cppcheck.sourceforge.net

Tasks

  • 1. Ознакомиться со ссылками учебного материала
  • 2. Используя cpplint провести анализ проекта на C++
  • 3. Используя Cppcheck провести анализ проекта на C++
  • 4. Используя OCLint провести анализ проекта на C++
  • 5. Используя Valgrind провести анализ проекта на C++
  • 6. Составить отчет и отправить ссылку личным сообщением в Slack

Tutorial

cpplint

$ cpplint ./sources/hello.cpp
Done processing sources/hello.cpp

Cppcheck

$ cppcheck ./sources/hello.cpp
Checking sources/hello.cpp...

OCLint

$ oclint ./sources/hello.cpp -- -c
OCLint Report
Summary: TotalFiles=1 FilesWithViolations=0 P1=0 P2=0 P3=0 
[OCLint (http://oclint.org) v0.13]

Valgrind

$ valgrind ./_builds/hello 
==28883== Memcheck, a memory error detector
==28883== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==28883== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==28883== Command: ./_builds/hello
==28883== 
Hello, World!
==28883== 
==28883== HEAP SUMMARY:
==28883==     in use at exit: 72,704 bytes in 1 blocks
==28883==   total heap usage: 2 allocs, 1 frees, 73,728 bytes allocated
==28883== 
==28883== LEAK SUMMARY:
==28883==    definitely lost: 0 bytes in 0 blocks
==28883==    indirectly lost: 0 bytes in 0 blocks
==28883==      possibly lost: 0 bytes in 0 blocks
==28883==    still reachable: 72,704 bytes in 1 blocks
==28883==         suppressed: 0 bytes in 0 blocks
==28883== Rerun with --leak-check=full to see details of leaked memory
==28883== 
==28883== For counts of detected and suppressed errors, rerun with: -v
==28883== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Links

Copyright (c) 2017 Братья Вершинины
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment