1. cppcheck 다운 및 설치

http://sourceforge.net/projects/cppcheck/


2. Visual Studio 설정

- [도구(T)] -> [외부 도구(E)] -> [추가]


3. 인수

--enable=all --enable=style -q --template vs $(ProjectDir)


-j [job count] : multithread로 체크


>> 파일 검사

Arguments : -j 8 --enable=warning,style,performance,portability,information --std=c++11 --inline-suppr --quiet --template="{file}({line}): {severity} ({id}): {message}" $(ItemPath)


>> 프로젝트 검사

Arguments : -j 8 --enable=warning,style,performance,portability,information --std=c++11 --inline-suppr --quiet --template="{file}({line}): {severity} ({id}): {message}" $(ProjectDir)


4. cppcheck 실행

- cppcheck 실행할 프로젝트 선택 후 [도구(T)] -> [cppcheck] 실행 하면 VS 출력창에 결과 출력



>> cppcheck 주요 검수 항목

 - 배열 인덱스 참조 위반

 - 생성자가 없는 클래스

 - 생성자가 초기화하지 않는 변수

 - 잘못된 메모리 초기화

 - 베이스 크래스의 소멸자는 가상 함수로 선언하지 않는 경우

 - 사용하지 않는 private 함수

 - operator= 가 self의 레퍼런스를 반환하지 않는 경우

 - operator= 가 자신과 동일한 타입의 객체를 할당하지 않는 경우

 - obsolete (폐기된) 함수(mktemp, gets, scanf)를 사용하는 경우

 - 메모리 누수

 - sprintf를 잘못 사용하는 경우

 - 숫자를 0으로 나누는 경우

 - null 포인터를 역참조 하는 경우

 - 초기화하지 않은 변수나 데이터를 사용하는 경우

 - 입력 스트림에 fflush()를 사용하는 경우

 - memset, memcpy 등이 클래스에서 사용될 때 경고



안정적인 DNS서비스 DNSEver DNS server, DNS service
Posted by 키르히아이스
,