f-stack/dpdk/devtools/cocci/zero_length_array.cocci

22 lines
260 B
Plaintext
Raw Normal View History

2023-09-13 12:21:49 +00:00
// 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;