336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

OCLint 는 정적 코드 분석 툴로 코드 품질 향상과, 결함을 줄이고, C, C++, Object-C 코르의 잠재적인 결함을 분석하기 위해 사용된다. (http://oclint.org/)


Homebrew를 이용한 설치 (for macOS user)

http://docs.oclint.org/en/stable/intro/homebrew.html


Install OCLint

$ brew tap oclint/formulae
$ brew install oclint
$ brew update
$ brew upgrade oclint

 현재 xocode 9.x 이상에서 설치됨



Tutorial

http://docs.oclint.org/en/stable/intro/tutorial.html


Build Sample Code

$ CC -c sample.cpp // step 1: compiling generates sample.o
$ CC -o sample sample.o // step 2: linking generates sample executable file

// Change CC to your favorite compiler that is GCC-compatible, e.g. g++ and clang++

$ ./sample // execute the binary
$ echo $? // output of 0 probably means the code has been successfully built


Checking Sing File

OCLint checks a single file using the following format:

oclint [options] <source> -- [compiler flags]

So, the command that applies to the sample source is

$ oclint sample.cpp -- -c

To change OCLint behavior, change the [options] before the source; to alter the compiler behavior, change the [compiler flags] after the -- separator. A complicated example might look like this:

$ oclint -report-type html -o report.html sample.cpp -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/usr/local/include -c


UsingOCLint in Xcode

http://docs.oclint.org/en/stable/guide/xcode.html




블로그 이미지

뚱땡이 우주인

,