osrm-backend/scripts/analyze.sh
Daniel J. Hofmann 9deadc1371 Static analysis: integration with the Static Analyzer.
This provides a wrapper script to invoke the Static Analyzer on the code
base. The script simply wraps your commands, that is you have to do the
following:

    ..scripts/analyze cmake ..
    ..scripts/analyze cmake --build .

Note: the Static Analyzer is integrated in Xcode, so if you are on a
Mac, consider using Xcode natively instead of this wrapper script that
will only give you HTML output.

Reference:

- http://clang-analyzer.llvm.org/
2015-09-22 17:32:32 +02:00

20 lines
743 B
Bash
Executable File

#!/usr/bin/env bash
# Runs the Static Analyzer on the code base.
# This is a wrapper intended to be used with like this:
# 1/ analyze cmake ..
# 2/ analyze cmake --build .
exec scan-build -analyze-headers -no-failure-reports --keep-going --status-bugs \
-enable-checker alpha.core.BoolAssignment \
-enable-checker alpha.core.IdenticalExpr \
-enable-checker alpha.core.TestAfterDivZero \
-enable-checker alpha.deadcode.UnreachableCode \
-enable-checker alpha.security.ArrayBoundV2 \
-enable-checker alpha.security.MallocOverflow \
-enable-checker alpha.security.ReturnPtrRange \
-enable-checker security.FloatLoopCounter \
-enable-checker security.insecureAPI.rand \
-enable-checker security.insecureAPI.strcpy \
"${@}"