by paulnechifor · 9y ago · 0 comments
Also this comment by Linus Torvalds (copy pasted because I don't know how to link to Google+ comments):
> I don't think that works. It breaks trivially for consecutive [] or * cases, something that he carefully didn't have in his examples.
> So the examples were made up to make it look like it's a spiral, but type parsing is about precedence, not about spirals. It so happens that the higher-precedence operators ([] and ()) are on the right-hand side, which is why it "works" to start on the right.
> And it doesn't explain why
> typedef int (fn_t[][2])(void);
> is ok, but
> typedef int
(fn_t[2][])(void);> is not.
> "Spirals"? I don't think so.
typedef int *(**fn_t[][2])(void);
is ok, but typedef int *(**fn_t[2][])(void);
is not.(fixed formatting?)