Messages in this thread | | | Subject | Re: [PATCH] sched/fair: Replace zero-length array with flexible-array member | From | Valentin Schneider <> | Date | Sun, 16 Feb 2020 23:38:46 +0000 |
| |
On 14/02/2020 02:05, Joe Perches wrote: > Nice. > It would miss a few forms like: > > typedef struct tagfoo { > ... > type t[0]; > } foo; > > and > > struct { > ... > type t[0]; > } foo; > > and > > struct foo { > ... > type t[0]; > } *foo; > > etc... > >
Right! Digging around for some examples on handling typedefs & co I stumbled on this construct:
T { <blah> };
This matches your typedef case, but none of the other two. I haven't found a nice way to match them without listing down some special cases, which I don't really like.
I might dig around sometime to figure out how this should be expressed; in the meantime a simple 'grep -r "\[0\];"' will most likely yield faster results (for hunting down ZLAs, that is).
| |