diff --git a/maint/coccinelle/ref-passed-variables-inited.cocci b/maint/coccinelle/ref-passed-variables-inited.cocci index 74e28a99d9..1cc28efea8 100644 --- a/maint/coccinelle/ref-passed-variables-inited.cocci +++ b/maint/coccinelle/ref-passed-variables-inited.cocci @@ -1,47 +1,48 @@ /* - * Copyright 2019 the Pacemaker project contributors + * Copyright 2019-2020 the Pacemaker project contributors * * The version control history for this file may have further details. * - * SPDX-License-Identifier: FSFAP + * This source code is licensed under the GNU General Public License version 2 + * or later (GPLv2+) WITHOUT ANY WARRANTY. * * * We require each local variable that * * - is passed to a function through a dereference (suggesting it serves * possibly also or merely as one of the output value propagators seperate * from actual return value if employed at all) and * * - is then subsequently reused (possibly naively expecting it will always * have been initialized (in said function at latest) further in its scope, * * to _always_ be assuredly initialized to some determined value, so as to * prevent a risk of accidentally accessing unspecified value subsequent * to the return from the considered function, which might not have set * that variable at all, lest it would touch it at all. */ @ref_passed_variables_inited exists@ identifier f_init, f_consume, var; type T; expression E, E_propagate; @@ T - var + var /*FIXME:initialize me*/ ; ... when != var = E f_init(..., &var, ...) ... when != var = E ( return var; | f_consume(..., var, ...) | E_propagate = var | &var | *var )