1 // SPDX-License-Identifier: GPL-2.0-only
3 /// Zero-length and one-element arrays are deprecated, see
4 /// Documentation/process/deprecated.rst
5 /// Flexible-array members should be used instead.
9 // Copyright: (C) 2020 Denis Efremov ISPRAS.
11 // Options: --no-includes --include-headers
20 def relevant(positions):
27 identifier name, array;
29 position p : script:python() { relevant(p) };
35 * T array@p[\(0\|1\)];
40 * T array@p[\(0\|1\)];
45 * T array@p[\(0\|1\)];
50 * T array@p[\(0\|1\)];
55 identifier name, array;
57 position p : script:python() { relevant(p) };
76 @script: python depends on report@
80 msg = "WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)"
81 coccilib.report.print_report(p[0], msg)
83 @script: python depends on org@
87 msg = "WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)"
88 coccilib.org.print_todo(p[0], msg)