This is the command scan-build-3.8 that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator
scan-build — Clang static analyzer
scan-build [-ohkvV] [-analyze-headers] [-enable-checker [checker_name]]
[-disable-checker [checker_name]] [--help] [--help-checkers]
[--html-title [=title]] [--keep-going] [-plist] [-plist-html] [--status-bugs]
[--use-c++ [=compiler_path]] [--use-cc [=compiler_path]] [--view]
[-constraints [model]] [-maxloop N] [-no-failure-reports] [-stats]
[-store [model]] build_command [build_options]
scan-build is a Perl script that invokes the Clang static analyzer. Options used by
scan-build or by the analyzer appear first, followed by the build_command and any
build_options normally used to build the target system.
The static analyzer employs a long list of checking algorithms, see CHECKERS. Output can be
written in standard .plist and/or HTML format.
The following options are supported:
Also analyze functions in #included files.
-enable-checker checker_name, -disable-checker checker_name
Enable/disable checker_name. See CHECKERS.
Display this message.
List default checkers, see CHECKERS.
Specify the title used on generated HTML pages. A default title is generated if
title is not specified.
Add a “keep on going” option to build_command. Currently supports make and
xcodebuild. This is a convenience option; one can specify this behavior directly
using build options.
-o Target directory for HTML report files. Subdirectories will be created as needed to
represent separate invocations of the analyzer. If this option is not specified, a
directory is created in /tmp (TMPDIR on Mac OS X) to store the reports.
-plist Output the results as a set of .plist files. (By default the output of scan-build is
a set of HTML files.)
Output the results as a set of HTML and .plist files
Set exit status to 1 if it found potential bugs and 0 otherwise. By default the exit
status of scan-build is that returned by build_command.
Guess the default compiler for your C++ and Objective-C++ code. Use this option to
specify an alternate compiler.
Guess the default compiler for your C and Objective-C code. Use this option to
specify an alternate compiler.
-v Verbose output from scan-build and the analyzer. A second and third v increases
View analysis results in a web browser when the build completes.
Specify the contraint engine used by the analyzer. By default the ‘range’ model is
used. Specifying ‘basic’ uses a simpler, less powerful constraint model used by
checker-0.160 and earlier.
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.
Do not create a ‘failures’ subdirectory that includes analyzer crash reports and
preprocessed source files.
-stats Generates visitation statistics for the project being analyzed.
Specify the store model used by the analyzer. By default, the ‘region’ store model
is used. ‘region’ specifies a field- sensitive store model. Users can also specify
‘basic’ which is far less precise but can more quickly analyze code. ‘basic’ was
the default store model for checker-0.221 and earlier.
scan-build returns the value returned by build_command unless --status-bugs or --keep-going
The checkers listed below may be enabled/disabled using the -enable-checker and
-disable-checker options. A default group of checkers is run unless explicitly disabled.
Exactly which checkers constitute the default group is a function of the operating system in
use; they are listed with --help-checkers.
Check to see if the return value of a function call is different than the caller
expects (e.g., from calls through function pointers).
Check for null pointers passed as arguments to a function whose arguments are
marked with the ‘nonnull’ attribute.
Check for logical errors for function calls and Objective-C message expressions
(e.g., uninitialized arguments, null function pointers).
Check for division by zero.
Check for dereferences of null pointers.
Check that addresses to stack memory do not escape the function.
Check for undefined results of binary operators.
Check for declarations of VLA of undefined or zero size.
Evaluate compiler builtin functions, e.g. alloca().
Evaluate ‘panic’ functions that are known to not return to the caller.
Check for uninitialized values used as array subscripts.
Check for assigning uninitialized values.
Check for uninitialized values used as branch conditions.
Check for blocks that capture uninitialized values.
Check for uninitialized values being returned to the caller.
Check for values stored to variables that are never read afterwards.
Display Control-Flow Graphs.
Display Call Graph.
Print the dominance tree for a given Control-Flow Graph.
Print results of live variable analysis.
Emit warnings with analyzer statistics.
Mark tainted symbols as such.
View Control-Flow Graphs using GraphViz.
View Call Graph using GraphViz.
Check code for LLVM codebase conventions.
osx.API Check for proper uses of various Mac OS X APIs.
Evaluate calls to OSAtomic functions.
Check for proper uses of Secure Keychain APIs.
Check for null pointers used as mutexes for @synchronized.
Check for sending ‘retain’, ‘release,’ or ‘autorelease’ directly to a Class.
Warn about Objective-C method signatures with type incompatibilities.
Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.
Check usage of NSError** parameters.
Check for prohibited nil arguments to Objective-C method calls.
Check for leaks and improper reference count management.
Check that ‘self’ is properly initialized inside an initializer method.
Warn about private ivars that are never used.
Check for passing non-Objective-C types to variadic methods that expect only
Check usage of CFErrorRef* parameters.
Check for proper uses of CFNumberCreate().
Check for null arguments to CFRetain(), CFRelease(), and CFMakeCollectable().
Checks for index out-of-bounds when using the CFArray API.
Warns if CFArray, CFDictionary, or CFSet are created with non-pointer-size values.
Warn on using a floating point value as a loop counter (CERT: FLP30-C, FLP30-CPP).
Warn on uses of functions whose return values must be always checked.
Warn on uses of getpw().
Warn on uses of gets().
Warn when mkstemp() is passed fewer than 6 X's in the format string.
Warn on uses of mktemp().
Warn on uses of rand(), random(), and related functions.
Warn on uses of strcpy() and strcat().
Warn on uses of vfork().
Check calls to various UNIX/Posix functions.
Check for memory leaks, double free, and use-after-free.
Check the size argument passed into C string functions for common erroneous
Check for null pointers being passed as arguments to C string functions.
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.
scan-build was written by Ted Kremenek. Documentation contributed by
James K. Lowden <firstname.lastname@example.org>.
Use scan-build-3.8 online using onworks.net services