xref: /freebsd/contrib/pam-krb5/tests/data/cppcheck.supp (revision bf6873c5786e333d679a7838d28812febf479a8a)
1// Suppressions file for cppcheck.  -*- conf -*-
2//
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.
6//
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
9// location, and line.
10//
11// Copyright 2018-2021 Russ Allbery <eagle@eyrie.org>
12//
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
16// warranty.
17//
18// SPDX-License-Identifier: FSFAP
19
20// I like declaring variables at the top of a function rather than cluttering
21// every if and loop body with declarations.
22variableScope
23
24// strlen of a constant string is more maintainable code than hard-coding the
25// string length.
26constArgument:tests/runtests.c:804
27
28// False positive due to recursive function.
29knownConditionTrueFalse:portable/getopt.c:146
30
31// Bug in cppcheck 2.3.  cppcheck can't see the assignment because of the
32// void * cast.
33knownConditionTrueFalse:portable/k_haspag.c:61
34
35// False positive since the string comes from a command-line define.
36knownConditionTrueFalse:tests/tap/process.c:415
37knownConditionTrueFalse:tests/tap/remctl.c:79
38
39// Stored in the returned ai struct, but cppcheck can't see the assignment
40// because of the struct sockaddr * cast.
41memleak:portable/getaddrinfo.c:236
42
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).
45nullPointer:portable/winsock.c:61
46
47// Bug in cppcheck 2.3.
48nullPointerRedundantCheck:portable/krb5-profile.c:61
49
50// Bug in cppcheck 2.3.
51nullPointerRedundantCheck:portable/krb5-renew.c:82
52nullPointerRedundantCheck:portable/krb5-renew.c:83
53
54// Setting the variable to NULL explicitly after deallocation.
55redundantAssignment:tests/pam-util/options-t.c
56
57// (remctl) Bug in cppcheck 1.89 (fixed in 2.3).  The address of these
58// variables are passed to a PHP function.
59uninitvar:php/php_remctl.c:119
60uninitvar:php/php_remctl.c:123
61uninitvar:php/php_remctl.c:315
62uninitvar:php/php5_remctl.c:125
63uninitvar:php/php5_remctl.c:129
64uninitvar:php/php5_remctl.c:321
65
66// (remctl) Bug in cppcheck 1.82.  A pointer to this array is stored in a
67// struct that's passed to another function.
68redundantAssignment:tests/server/acl-t.c
69
70// (pam-krb5) cppcheck doesn't recognize the unused attribute on labels.
71unusedLabel:module/auth.c:895
72unusedLabelConfiguration:module/auth.c:895
73