Eric Blake <ebl...@redhat.com> writes:

> 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.

For what it's worth, I'd prefer a rewording.

Reply via email to