On Tue, Nov 17, 2020 at 11:25 AM Jakub Jelinek <ja...@redhat.com> wrote: > > It would need to be typeof( (typeof(type)) (type) ) to not be that > constrained on what kind of expressions it accepts as arguments.
Yup. > Anyway, it won't work with array types at least, > int a[10]; > typeof ((typeof (a)) (a)) b; > is an error (in both gcc and clang), while typeof (a) b; will work > (but not drop the qualifiers). Don't know if the kernel cares or not. Well, the kernel already doesn't allow that, because our existing horror only handles simple integer scalar types. So that macro is a clear improvement - if it actually works (local testing says it does, but who knows about random compiler versions etc) Linus