Messages in this thread | | | From | Linus Torvalds <> | Date | Fri, 18 Sep 2020 13:14:54 -0700 | Subject | Re: [GIT PULL] percpu fix for v5.9-rc6 |
| |
On Fri, Sep 18, 2020 at 1:02 PM Matthew Wilcox <willy@infradead.org> wrote: > > I suppose it's not really necessary, we could do offsetof here, right?
Yup, that would make a lot more sense.
But right now, the sizeof() obviously silently works.
As do a number of other fairly nonsensical things, like assigning a struct etc.
And yes, I realize we may well do that too. But I think that's a dangerous pattern too, ie doing
*a = *b;
silently works, and copies everything but the final array.
And yes - none of this is _worse_ than using zero-sized arrays, but the point is that it isn't better either.
Linus
| |