coccinelle: misc: add flexible_array.cocci script

One-element and zero-length arrays are deprecated [1]. Kernel
code should always use "flexible array members" instead, except
for existing uapi definitions.

The script warns about one-element and zero-length arrays in structs.

[1] commit 68e4cd17e218 ("docs: deprecated.rst: Add zero-length and
    one-element arrays")

Cc: Kees Cook <[email protected]>
Cc: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Denis Efremov <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
1 file changed