Re: [PATCH] sched/fair: Replace zero-length array with flexible-array member

From: Valentin Schneider
Date: Sun Feb 16 2020 - 18:39:07 EST


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).