* Eric Blake (ebl...@redhat.com) wrote: > On 9/11/19 12:40 PM, Eric Blake wrote: > > >> + > >> +#define RCU_READ_LOCK_AUTO g_auto(rcu_read_auto_t) \ > >> + _rcu_read_auto = 'x'; \ > > > > I'm a bit lost at where _rcu_read_auto is declared. (I could understand > > if an earlier macro had created that typedef via concatenating _ with > > rcu_read_auto_t, but making the preprocessor drop _t is not possible. Is > > this a typo, and if so, why did the compiler not complain?) > > Okay, I read it wrong. This rendering would be easier for me to > understand (you are declaring a dummy variable right here): > > #define RCU_READ_LOCK_AUTO \ > g_auto(rcu_read_auto_t) _rcu_read_auto = 'x'; \ > ... > > In other words, I'm not used to expecting a split between type and > variable name across two lines, especially when the type is itself a > macro call, and where my first reading didn't spot that > (rcu_read_auto_t) was not the name of the argument to a mixed-case macro > RCU_READ_LOACK_AUTO_g_auto, rather than g_auto(...) being the start of > the parameter-less macro RCU_READ_LOCK_AUTO definition.
Yep, that's simplified after the rework Dan suggested. Dave > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3226 > Virtualization: qemu.org | libvirt.org > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK