On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > There are theoretical concerns that some compilers might not trigger > build failures on attempts to define an array of size -1 and make it a > variable sized array instead.
Rather, the concern is that if someone changes code so that the 'x' of QEMU_BUILD_BUG_ON(x) is no longer a compile time constant, we want a compile-time failure rather than a runtime variable-sized array that may or may not crash. > Let rewrite using a struct with a negative > bit field size instead as there are no dynamic bit field sizes. This is > similar to what Linux does. > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > --- > include/qemu/compiler.h | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > I don't know if you want to tweak the commit wording, but I'm okay with the patch itself. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature