xref: /dpdk/devtools/cocci/zero_length_array.cocci (revision beeed9d92aca54f9e7a3881a14af2528bb227926)
1*beeed9d9SBruce Richardson// Replace zero-length array members with []
2*beeed9d9SBruce Richardson@@
3*beeed9d9SBruce Richardsonidentifier st, member, arr;
4*beeed9d9SBruce Richardsontype T1, T2;
5*beeed9d9SBruce Richardson@@
6*beeed9d9SBruce Richardsonstruct st {
7*beeed9d9SBruce Richardson	...
8*beeed9d9SBruce Richardson	T1 member;
9*beeed9d9SBruce Richardson-	T2 arr[0];
10*beeed9d9SBruce Richardson+	T2 arr[];
11*beeed9d9SBruce Richardson};
12*beeed9d9SBruce Richardson@@
13*beeed9d9SBruce Richardsonidentifier st, member, arr, id;
14*beeed9d9SBruce Richardsontype T1, T2;
15*beeed9d9SBruce Richardson@@
16*beeed9d9SBruce Richardsonstruct st {
17*beeed9d9SBruce Richardson	...
18*beeed9d9SBruce Richardson	T1 member;
19*beeed9d9SBruce Richardson-	T2 arr[0];
20*beeed9d9SBruce Richardson+	T2 arr[];
21*beeed9d9SBruce Richardson} id;
22