* [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0
@ 2018-05-12 1:48 Richard Henderson
2018-05-12 1:48 ` [Qemu-devel] [PATCH 2/2] target/s390x: " Richard Henderson
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Richard Henderson @ 2018-05-12 1:48 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael S . Tsirkin
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
as an extension.
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/virtio/vhost-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 38da8692bb..b455fca394 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -1316,7 +1316,7 @@ static bool vhost_user_requires_shm_log(struct vhost_dev *dev)
static int vhost_user_migration_done(struct vhost_dev *dev, char* mac_addr)
{
- VhostUserMsg msg = { 0 };
+ VhostUserMsg msg = { };
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
--
2.17.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0
2018-05-12 1:48 [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0 Richard Henderson
@ 2018-05-12 1:48 ` Richard Henderson
2018-05-14 15:44 ` Philippe Mathieu-Daudé
2018-05-14 15:44 ` [Qemu-devel] [PATCH 1/2] hw/virtio: " Philippe Mathieu-Daudé
2018-05-15 15:03 ` Eric Blake
2 siblings, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2018-05-12 1:48 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexander Graf, David Hildenbrand, Cornelia Huck
The warning is
target/s390x/misc_helper.c:209:21: error: suggest
braces around initialization of subobject [-Werror,-Wmissing-braces]
SysIB sysib = { 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
as an extension.
Cc: Alexander Graf <agraf@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/s390x/misc_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index e0b23c1fd1..1f834f35ef 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -206,7 +206,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
const MachineState *ms = MACHINE(qdev_get_machine());
uint16_t total_cpus = 0, conf_cpus = 0, reserved_cpus = 0;
S390CPU *cpu = s390_env_get_cpu(env);
- SysIB sysib = { 0 };
+ SysIB sysib = { };
int i, cc = 0;
if ((r0 & STSI_R0_FC_MASK) > STSI_R0_FC_LEVEL_3) {
--
2.17.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0
2018-05-12 1:48 ` [Qemu-devel] [PATCH 2/2] target/s390x: " Richard Henderson
@ 2018-05-14 15:44 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-05-14 15:44 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: Cornelia Huck, Alexander Graf, David Hildenbrand
On 05/11/2018 10:48 PM, Richard Henderson wrote:
> The warning is
>
> target/s390x/misc_helper.c:209:21: error: suggest
> braces around initialization of subobject [-Werror,-Wmissing-braces]
> SysIB sysib = { 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
> as an extension.
>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> target/s390x/misc_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index e0b23c1fd1..1f834f35ef 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -206,7 +206,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
> const MachineState *ms = MACHINE(qdev_get_machine());
> uint16_t total_cpus = 0, conf_cpus = 0, reserved_cpus = 0;
> S390CPU *cpu = s390_env_get_cpu(env);
> - SysIB sysib = { 0 };
> + SysIB sysib = { };
> int i, cc = 0;
>
> if ((r0 & STSI_R0_FC_MASK) > STSI_R0_FC_LEVEL_3) {
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0
2018-05-12 1:48 [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0 Richard Henderson
2018-05-12 1:48 ` [Qemu-devel] [PATCH 2/2] target/s390x: " Richard Henderson
@ 2018-05-14 15:44 ` Philippe Mathieu-Daudé
2018-05-15 15:03 ` Eric Blake
2 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-05-14 15:44 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: Michael S . Tsirkin
On 05/11/2018 10: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
> as an extension.
>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/virtio/vhost-user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index 38da8692bb..b455fca394 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -1316,7 +1316,7 @@ static bool vhost_user_requires_shm_log(struct vhost_dev *dev)
>
> static int vhost_user_migration_done(struct vhost_dev *dev, char* mac_addr)
> {
> - VhostUserMsg msg = { 0 };
> + VhostUserMsg msg = { };
>
> assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0
2018-05-12 1:48 [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0 Richard Henderson
2018-05-12 1:48 ` [Qemu-devel] [PATCH 2/2] target/s390x: " Richard Henderson
2018-05-14 15:44 ` [Qemu-devel] [PATCH 1/2] hw/virtio: " Philippe Mathieu-Daudé
@ 2018-05-15 15:03 ` Eric Blake
2 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2018-05-15 15:03 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: Michael S . Tsirkin
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 <mst@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 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 <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 0/9] target/m68k: Convert to TranslatorOps
@ 2018-05-12 4:59 Richard Henderson
2018-05-12 4:59 ` [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0 Richard Henderson
0 siblings, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2018-05-12 4:59 UTC (permalink / raw)
To: qemu-devel; +Cc: laurent
FYI, I've only tested this with linux-user-test-0.3 and
our qemu coldfire testing kernel.
r~
Richard Henderson (9):
target/m68k: Use DISAS_NORETURN for exceptions
target/m68k: Replace DISAS_TB_JUMP with DISAS_NORETURN
target/m68k: Remove DISAS_JUMP_NEXT as unused
target/m68k: Use lookup_and_goto_tb for DISAS_JUMP
target/m68k: Rename DISAS_UPDATE and gen_lookup_tb
target/m68k: Convert to DisasContextBase
target/m68k: Convert to TranslatorOps
target/m68k: Improve ending TB at page boundaries
target/m68k: Merge disas_m68k_insn into m68k_tr_translate_insn
target/m68k/translate.c | 354 ++++++++++++++++++++--------------------
1 file changed, 179 insertions(+), 175 deletions(-)
--
2.17.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0
2018-05-12 4:59 [Qemu-devel] [PATCH 0/9] target/m68k: Convert to TranslatorOps Richard Henderson
@ 2018-05-12 4:59 ` Richard Henderson
2018-05-12 7:56 ` David Hildenbrand
2018-05-14 10:16 ` Cornelia Huck
0 siblings, 2 replies; 8+ messages in thread
From: Richard Henderson @ 2018-05-12 4:59 UTC (permalink / raw)
To: qemu-devel; +Cc: laurent, Alexander Graf, David Hildenbrand, Cornelia Huck
The warning is
target/s390x/misc_helper.c:209:21: error: suggest
braces around initialization of subobject [-Werror,-Wmissing-braces]
SysIB sysib = { 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
as an extension.
Cc: Alexander Graf <agraf@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/s390x/misc_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index e0b23c1fd1..1f834f35ef 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -206,7 +206,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
const MachineState *ms = MACHINE(qdev_get_machine());
uint16_t total_cpus = 0, conf_cpus = 0, reserved_cpus = 0;
S390CPU *cpu = s390_env_get_cpu(env);
- SysIB sysib = { 0 };
+ SysIB sysib = { };
int i, cc = 0;
if ((r0 & STSI_R0_FC_MASK) > STSI_R0_FC_LEVEL_3) {
--
2.17.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0
2018-05-12 4:59 ` [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0 Richard Henderson
@ 2018-05-12 7:56 ` David Hildenbrand
2018-05-14 10:16 ` Cornelia Huck
1 sibling, 0 replies; 8+ messages in thread
From: David Hildenbrand @ 2018-05-12 7:56 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: laurent, Alexander Graf, Cornelia Huck
On 12.05.2018 06:59, Richard Henderson wrote:
> The warning is
>
> target/s390x/misc_helper.c:209:21: error: suggest
> braces around initialization of subobject [-Werror,-Wmissing-braces]
> SysIB sysib = { 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
> as an extension.
>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/s390x/misc_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index e0b23c1fd1..1f834f35ef 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -206,7 +206,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
> const MachineState *ms = MACHINE(qdev_get_machine());
> uint16_t total_cpus = 0, conf_cpus = 0, reserved_cpus = 0;
> S390CPU *cpu = s390_env_get_cpu(env);
> - SysIB sysib = { 0 };
> + SysIB sysib = { };
> int i, cc = 0;
>
> if ((r0 & STSI_R0_FC_MASK) > STSI_R0_FC_LEVEL_3) {
>
Very strange that this is reported as an error if it is technically the
right thing to do. Anyhow, to make compilers happy:
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0
2018-05-12 4:59 ` [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0 Richard Henderson
2018-05-12 7:56 ` David Hildenbrand
@ 2018-05-14 10:16 ` Cornelia Huck
1 sibling, 0 replies; 8+ messages in thread
From: Cornelia Huck @ 2018-05-14 10:16 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, laurent, Alexander Graf, David Hildenbrand
On Fri, 11 May 2018 21:59:43 -0700
Richard Henderson <richard.henderson@linaro.org> wrote:
> The warning is
>
> target/s390x/misc_helper.c:209:21: error: suggest
> braces around initialization of subobject [-Werror,-Wmissing-braces]
> SysIB sysib = { 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
> as an extension.
>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/s390x/misc_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index e0b23c1fd1..1f834f35ef 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -206,7 +206,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
> const MachineState *ms = MACHINE(qdev_get_machine());
> uint16_t total_cpus = 0, conf_cpus = 0, reserved_cpus = 0;
> S390CPU *cpu = s390_env_get_cpu(env);
> - SysIB sysib = { 0 };
> + SysIB sysib = { };
> int i, cc = 0;
>
> if ((r0 & STSI_R0_FC_MASK) > STSI_R0_FC_LEVEL_3) {
Thanks, applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-05-15 15:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 1:48 [Qemu-devel] [PATCH 1/2] hw/virtio: Fix brace Werror with clang 6.0.0 Richard Henderson
2018-05-12 1:48 ` [Qemu-devel] [PATCH 2/2] target/s390x: " Richard Henderson
2018-05-14 15:44 ` Philippe Mathieu-Daudé
2018-05-14 15:44 ` [Qemu-devel] [PATCH 1/2] hw/virtio: " Philippe Mathieu-Daudé
2018-05-15 15:03 ` Eric Blake
2018-05-12 4:59 [Qemu-devel] [PATCH 0/9] target/m68k: Convert to TranslatorOps Richard Henderson
2018-05-12 4:59 ` [Qemu-devel] [PATCH 2/2] target/s390x: Fix brace Werror with clang 6.0.0 Richard Henderson
2018-05-12 7:56 ` David Hildenbrand
2018-05-14 10:16 ` Cornelia Huck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.