scan-build-4.0 -V (return code: 1)
scan-build: unrecognized option '--version'
scan-build-4.0 --help (return code: -15)
USAGE: scan-build [options] <build command> [build options]
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.
--force-analyze-debug-code
Tells analyzer to enable assertions in code even if they were disabled
during compilation to enable more precise results.
-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.
--show-description
Display the description of defects in the list
-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.
If the given compiler is a cross compiler, you may also need to provide
--analyzer-target option to properly analyze the source code because static
analyzer runs as if the code is compiled for the host machine by default.
--use-c++ [compiler path]
--use-c++=[compiler path]
This is the same as "--use-cc" but for C++ code.
--analyzer-target [target triple name for analysis]
--analyzer-target=[target triple name for analysis]
This provides target triple information to clang static analyzer.
It only changes the target for analysis but doesn't change the target of a
real compiler given by --use-cc and --use-c++ options.
-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.
--override-compiler
Always resort to the ccc-analyzer even when better interposition methods
are available.
-analyzer-config <options>
Provide options to pass through to the analyzer's -analyzer-config flag.
Several options are separated with comma: 'key1=val1,key2=val2'
Available options:
* stable-report-filename=true or false (default)
Switch the page naming to:
report-<filename>-<function/method name>-<id>.html
instead of report-XXXXXX.html
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]