1 // Suppressions file for cppcheck.
3 // This includes suppressions for all of my projects, including files that
4 // aren't in rra-c-util, for ease of sharing between projects. The ones that
5 // don't apply to a particular project should hopefully be harmless.
7 // To determine the correct suppression to add for a new error, run cppcheck
8 // with the --xml flag and then add a suppression for the error id, file
11 // Copyright 2018-2023 Russ Allbery <eagle@eyrie.org>
13 // Copying and distribution of this file, with or without modification, are
14 // permitted in any medium without royalty provided the copyright notice and
15 // this notice are preserved. This file is offered as-is, without any
18 // SPDX-License-Identifier: FSFAP
20 // I like declaring variables at the top of a function rather than cluttering
21 // every if and loop body with declarations.
24 // strlen of a constant string is more maintainable code than hard-coding the
26 constArgument:tests/runtests.c:804
28 // False positive due to recursive function.
29 knownConditionTrueFalse:portable/getopt.c:146
31 // Bug in cppcheck 2.3. cppcheck can't see the assignment because of the
33 knownConditionTrueFalse:portable/k_haspag.c:61
35 // False positive since the string comes from a command-line define.
36 knownConditionTrueFalse:tests/tap/process.c:415
37 knownConditionTrueFalse:tests/tap/remctl.c:79
39 // Stored in the returned ai struct, but cppcheck can't see the assignment
40 // because of the struct sockaddr * cast.
41 memleak:portable/getaddrinfo.c:236
43 // Bug in cppcheck 1.89 (fixed in 2.3). The address of this variable is
44 // passed to a Windows function (albeit through a cast).
45 nullPointer:portable/winsock.c:62
47 // Bug in cppcheck 2.3.
48 nullPointerRedundantCheck:portable/krb5-profile.c:61
50 // Bug in cppcheck 2.3.
51 nullPointerRedundantCheck:portable/krb5-renew.c:82
52 nullPointerRedundantCheck:portable/krb5-renew.c:83
54 // (krb5-strength) Bug in cppcheck 2.12.0.
55 nullPointerRedundantCheck:tests/plugin/heimdal-t.c:81
56 nullPointerRedundantCheck:tests/plugin/mit-t.c:91
57 nullPointerRedundantCheck:tests/plugin/mit-t.c:97
59 // Setting the variable to NULL explicitly after deallocation.
60 redundantAssignment:tests/pam-util/options-t.c
62 // (remctl) Bug in cppcheck 1.89 (fixed in 2.3). The address of these
63 // variables are passed to a PHP function.
64 uninitvar:php/php_remctl.c:119
65 uninitvar:php/php_remctl.c:123
66 uninitvar:php/php_remctl.c:315
67 uninitvar:php/php5_remctl.c:125
68 uninitvar:php/php5_remctl.c:129
69 uninitvar:php/php5_remctl.c:321
71 // (remctl) Bug in cppcheck 1.82. A pointer to this array is stored in a
72 // struct that's passed to another function.
73 redundantAssignment:tests/server/acl-t.c
75 // (pam-krb5) cppcheck doesn't recognize the unused attribute on labels.
76 unusedLabel:module/auth.c:895
77 unusedLabelConfiguration:module/auth.c:895
79 // Bug in cppcheck 2.7. Two possible struct layouts are chosen based on the
80 // ABI, and the one chosen is used, but cppcheck always warns about both even
81 // if the preprocessor conditionals are identical.
82 unusedStructMember:kafs/sys-solaris.c