[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0 |
Date: |
Tue, 15 May 2018 10:03:22 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/11/2018 08:48 PM, Richard Henderson wrote:
The warning is
hw/virtio/vhost-user.c:1319:26: error: suggest braces
around initialization of subobject [-Werror,-Wmissing-braces]
VhostUserMsg msg = { 0 };
^
{}
While the original code is correct, and technically exactly correct
as per ISO C89, both GCC and Clang support plain empty set of braces
s/C89/C99/ (the guarantee of a universal {0} initializer was only added
in C99, if I recall correctly)
as an extension.
Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
hw/virtio/vhost-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
It's annoying that we have to work around clang's bogus warning by
resorting to an extension. But such is life.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org