* Eric Blake (ebl...@redhat.com) wrote: > On 01/20/2017 03:41 AM, Dr. David Alan Gilbert wrote: > > >> -#define QEMU_BUILD_BUG_ON(x) \ > >> - typedef char glue(qemu_build_bug_on__, __LINE__)[(x) ? -1 : 1] \ > >> - __attribute__((unused)) > >> +#define QEMU_BUILD_BUG_ON_STRUCT(x) \ > >> + struct { \ > >> + int qemu_build_bug_on : (x) ? -1 : 1; \ > >> + } > > > > The problem with this is it can't be used as an expression, where as > > your previous version could. > > I've got a similar case (see previous reply) that needed an expression > > bug-on that would evaluate to zero. > > Keep reading the series - the version usable in an expression is > QEMU_BUILD_BUG_ON_ZERO, introduced in 3/4. Patch 2/4 is just rewriting > the existing check, with no change in the fact that it is still a > declaration.
Ah hmm, yeh that's OK. Dave > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK