xref: /freebsd/contrib/pam-krb5/tests/data/cppcheck.supp (revision bf6873c5786e333d679a7838d28812febf479a8a)
1*bf6873c5SCy Schubert// Suppressions file for cppcheck.  -*- conf -*-
2*bf6873c5SCy Schubert//
3*bf6873c5SCy Schubert// This includes suppressions for all of my projects, including files that
4*bf6873c5SCy Schubert// aren't in rra-c-util, for ease of sharing between projects.  The ones that
5*bf6873c5SCy Schubert// don't apply to a particular project should hopefully be harmless.
6*bf6873c5SCy Schubert//
7*bf6873c5SCy Schubert// To determine the correct suppression to add for a new error, run cppcheck
8*bf6873c5SCy Schubert// with the --xml flag and then add a suppression for the error id, file
9*bf6873c5SCy Schubert// location, and line.
10*bf6873c5SCy Schubert//
11*bf6873c5SCy Schubert// Copyright 2018-2021 Russ Allbery <eagle@eyrie.org>
12*bf6873c5SCy Schubert//
13*bf6873c5SCy Schubert// Copying and distribution of this file, with or without modification, are
14*bf6873c5SCy Schubert// permitted in any medium without royalty provided the copyright notice and
15*bf6873c5SCy Schubert// this notice are preserved.  This file is offered as-is, without any
16*bf6873c5SCy Schubert// warranty.
17*bf6873c5SCy Schubert//
18*bf6873c5SCy Schubert// SPDX-License-Identifier: FSFAP
19*bf6873c5SCy Schubert
20*bf6873c5SCy Schubert// I like declaring variables at the top of a function rather than cluttering
21*bf6873c5SCy Schubert// every if and loop body with declarations.
22*bf6873c5SCy SchubertvariableScope
23*bf6873c5SCy Schubert
24*bf6873c5SCy Schubert// strlen of a constant string is more maintainable code than hard-coding the
25*bf6873c5SCy Schubert// string length.
26*bf6873c5SCy SchubertconstArgument:tests/runtests.c:804
27*bf6873c5SCy Schubert
28*bf6873c5SCy Schubert// False positive due to recursive function.
29*bf6873c5SCy SchubertknownConditionTrueFalse:portable/getopt.c:146
30*bf6873c5SCy Schubert
31*bf6873c5SCy Schubert// Bug in cppcheck 2.3.  cppcheck can't see the assignment because of the
32*bf6873c5SCy Schubert// void * cast.
33*bf6873c5SCy SchubertknownConditionTrueFalse:portable/k_haspag.c:61
34*bf6873c5SCy Schubert
35*bf6873c5SCy Schubert// False positive since the string comes from a command-line define.
36*bf6873c5SCy SchubertknownConditionTrueFalse:tests/tap/process.c:415
37*bf6873c5SCy SchubertknownConditionTrueFalse:tests/tap/remctl.c:79
38*bf6873c5SCy Schubert
39*bf6873c5SCy Schubert// Stored in the returned ai struct, but cppcheck can't see the assignment
40*bf6873c5SCy Schubert// because of the struct sockaddr * cast.
41*bf6873c5SCy Schubertmemleak:portable/getaddrinfo.c:236
42*bf6873c5SCy Schubert
43*bf6873c5SCy Schubert// Bug in cppcheck 1.89 (fixed in 2.3).  The address of this variable is
44*bf6873c5SCy Schubert// passed to a Windows function (albeit through a cast).
45*bf6873c5SCy SchubertnullPointer:portable/winsock.c:61
46*bf6873c5SCy Schubert
47*bf6873c5SCy Schubert// Bug in cppcheck 2.3.
48*bf6873c5SCy SchubertnullPointerRedundantCheck:portable/krb5-profile.c:61
49*bf6873c5SCy Schubert
50*bf6873c5SCy Schubert// Bug in cppcheck 2.3.
51*bf6873c5SCy SchubertnullPointerRedundantCheck:portable/krb5-renew.c:82
52*bf6873c5SCy SchubertnullPointerRedundantCheck:portable/krb5-renew.c:83
53*bf6873c5SCy Schubert
54*bf6873c5SCy Schubert// Setting the variable to NULL explicitly after deallocation.
55*bf6873c5SCy SchubertredundantAssignment:tests/pam-util/options-t.c
56*bf6873c5SCy Schubert
57*bf6873c5SCy Schubert// (remctl) Bug in cppcheck 1.89 (fixed in 2.3).  The address of these
58*bf6873c5SCy Schubert// variables are passed to a PHP function.
59*bf6873c5SCy Schubertuninitvar:php/php_remctl.c:119
60*bf6873c5SCy Schubertuninitvar:php/php_remctl.c:123
61*bf6873c5SCy Schubertuninitvar:php/php_remctl.c:315
62*bf6873c5SCy Schubertuninitvar:php/php5_remctl.c:125
63*bf6873c5SCy Schubertuninitvar:php/php5_remctl.c:129
64*bf6873c5SCy Schubertuninitvar:php/php5_remctl.c:321
65*bf6873c5SCy Schubert
66*bf6873c5SCy Schubert// (remctl) Bug in cppcheck 1.82.  A pointer to this array is stored in a
67*bf6873c5SCy Schubert// struct that's passed to another function.
68*bf6873c5SCy SchubertredundantAssignment:tests/server/acl-t.c
69*bf6873c5SCy Schubert
70*bf6873c5SCy Schubert// (pam-krb5) cppcheck doesn't recognize the unused attribute on labels.
71*bf6873c5SCy SchubertunusedLabel:module/auth.c:895
72*bf6873c5SCy SchubertunusedLabelConfiguration:module/auth.c:895
73