File: zero_length_array.cocci

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (21 lines) | stat: -rw-r--r-- 260 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Replace zero-length array members with []
@@
identifier st, member, arr;
type T1, T2;
@@
struct st {
	...
	T1 member;
-	T2 arr[0];
+	T2 arr[];
};
@@
identifier st, member, arr, id;
type T1, T2;
@@
struct st {
	...
	T1 member;
-	T2 arr[0];
+	T2 arr[];
} id;