summaryrefslogtreecommitdiffstats
path: root/scripts/run-scanbuild-with-args.sh
blob: b2954536be55cd7d2e8bf8312cc81cd6137e8d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
set -o errexit -o nounset

# following checkers are disabled on purpose:
# Clang does not support attribute cleanup and this is causing false positives in following checkers:
# unix.Malloc
# alpha.unix.SimpleStream
# alpha.unix.Stream
# https://bugs.llvm.org/show_bug.cgi?id=3888

# These are disabled for other reasons:
# alpha.clone.CloneChecker # way too many false positives
# alpha.core.CastToStruct # we use this pattern too much, hard to avoid in many cases
# alpha.deadcode.UnreachableCode # false positives/flags sanity checks depending on implementation details
# alpha.security.MallocOverflow # not smart enough to infer max values from data types

exec scan-build --status-bugs -no-failure-reports \
-analyzer-config  aggressive-binary-operation-simplification=true \
-disable-checker  unix.Malloc \
-enable-checker   alpha.core.BoolAssignment \
-enable-checker   alpha.core.CastSize \
-enable-checker   alpha.core.Conversion \
-enable-checker   alpha.core.DynamicTypeChecker \
-enable-checker   alpha.core.FixedAddr \
-enable-checker   alpha.core.IdenticalExpr \
-enable-checker   alpha.core.PointerArithm \
-enable-checker   alpha.core.PointerSub \
-enable-checker   alpha.core.SizeofPtr \
-enable-checker   alpha.core.TestAfterDivZero \
-enable-checker   alpha.cplusplus.IteratorRange \
-enable-checker   alpha.security.ArrayBound \
-enable-checker   alpha.security.ArrayBoundV2 \
-enable-checker   alpha.security.ReturnPtrRange \
-enable-checker   alpha.security.taint.TaintPropagation \
-enable-checker   alpha.unix.BlockInCriticalSection \
-enable-checker   alpha.unix.Chroot \
-enable-checker   alpha.unix.PthreadLock \
-enable-checker   alpha.unix.cstring.BufferOverlap \
-enable-checker   alpha.unix.cstring.NotNullTerminated \
-enable-checker   alpha.unix.cstring.OutOfBounds \
-enable-checker   nullability.NullableDereferenced \
-enable-checker   nullability.NullablePassedToNonnull \
-enable-checker   nullability.NullableReturnedFromNonnull \
-enable-checker   optin.performance.Padding \
-enable-checker   optin.portability.UnixAPI \
-enable-checker   security.FloatLoopCounter \
-enable-checker   valist.CopyToSelf \
-enable-checker   valist.Uninitialized \
-enable-checker   valist.Unterminated \
"$@"