1 // SPDX-License-Identifier: GPL-2.0-only
3 /// Please, don't reintroduce uninitialized_var().
4 /// From Documentation/process/deprecated.rst:
5 /// For any compiler warnings about uninitialized variables, just add
6 /// an initializer. Using warning-silencing tricks is dangerous as it
7 /// papers over real bugs (or can in the future), and suppresses unrelated
8 /// compiler warnings (e.g. "unused variable"). If the compiler thinks it
9 /// is uninitialized, either simply initialize the variable or make compiler
10 /// changes. Keep in mind that in most cases, if an initialization is
11 /// obviously redundant, the compiler's dead-store elimination pass will make
12 /// sure there are no needless variable writes.
15 // Copyright: (C) 2020 Denis Efremov ISPRAS
16 // Options: --no-includes --include-headers
32 * T var =@p *(&(var));
39 @script:python depends on report@
43 coccilib.report.print_report(p[0],
44 "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)")
46 @script:python depends on org@
50 coccilib.org.print_todo(p[0],
51 "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)")