scan-build static analyze help

來源:互聯網
上載者:User

標籤:des   os   io   for   cti   html   

USAGE: scan-build [options] <build command> [build options]

ANALYZER BUILD: checker-275 (2013-05-23 17:38:31)

OPTIONS:

-analyze-headers

Also analyze functions in #included files. By default, such functions
are skipped unless they are called by functions within the main source file.

-o <output location>

Specifies the output directory for analyzer reports. Subdirectories will be
created as needed to represent separate "runs" of the analyzer. If this
option is not specified, a directory is created in /tmp (TMPDIR on Mac OS X)
to store the reports.

-h
--help

Display this message.

-k
--keep-going

Add a "keep on going" option to the specified build command. This option
currently supports make and xcodebuild. This is a convenience option; one
can specify this behavior directly using build options.

--html-title [title]
--html-title=[title]

Specify the title used on generated HTML pages. If not specified, a default
title will be used.

-plist

By default the output of scan-build is a set of HTML files. This option
outputs the results as a set of .plist files.

-plist-html

By default the output of scan-build is a set of HTML files. This option
outputs the results as a set of HTML and .plist files.

--status-bugs

By default, the exit status of scan-build is the same as the executed build
command. Specifying this option causes the exit status of scan-build to be 1
if it found potential bugs and 0 otherwise.

--use-cc [compiler path]
--use-cc=[compiler path]

scan-build analyzes a project by interposing a "fake compiler", which
executes a real compiler for compilation and the static analyzer for analysis.
Because of the current implementation of interposition, scan-build does not
know what compiler your project normally uses. Instead, it simply overrides
the CC environment variable, and guesses your default compiler.

In the future, this interposition mechanism to be improved, but if you need
scan-build to use a specific compiler for *compilation* then you can use
this option to specify a path to that compiler.

--use-c++ [compiler path]
--use-c++=[compiler path]

This is the same as "-use-cc" but for C++ code.

-v

Enable verbose output from scan-build. A second and third ‘-v‘ increases
verbosity.

-V
--view

View analysis results in a web browser when the build completes.

ADVANCED OPTIONS:

-no-failure-reports

Do not create a ‘failures‘ subdirectory that includes analyzer crash reports
and preprocessed source files.

-stats

Generates visitation statistics for the project being analyzed.

-maxloop <loop count>

Specifiy the number of times a block can be visited before giving up.
Default is 4. Increase for more comprehensive coverage at a cost of speed.

-internal-stats

Generate internal analyzer statistics.

--use-analyzer [Xcode|path to clang]
--use-analyzer=[Xcode|path to clang]

scan-build uses the ‘clang‘ executable relative to itself for static
analysis. One can override this behavior with this option by using the
‘clang‘ packaged with Xcode (on OS X) or from the PATH.

--keep-empty

Don‘t remove the build results directory even if no issues were reported.

CONTROLLING CHECKERS:

A default group of checkers are always run unless explicitly disabled.
Checkers may be enabled/disabled using the following options:

-enable-checker [checker name]
-disable-checker [checker name]

LOADING CHECKERS:

Loading external checkers using the clang plugin interface:

-load-plugin [plugin library]
*** Could not query Clang for the list of available checkers.
BUILD OPTIONS

You can specify any build option acceptable to the build command.

EXAMPLE

scan-build -o /tmp/myhtmldir make -j4

The above example causes analysis reports to be deposited into a subdirectory
of "/tmp/myhtmldir" and to run "make" with the "-j4" option. A different
subdirectory is created each time scan-build analyzes a project. The analyzer
should support most parallel builds, but not distributed builds.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.