diff options
author | John Snow <jsnow@redhat.com> | 2018-11-27 13:49:29 -0500 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-11-27 23:56:12 +0000 |
commit | 039d4e3df0049bdd8f93a2de735a816483b13954 (patch) | |
tree | d7c9985fe54fca3f6198f010e9b1865041893d7c | |
parent | 549b50a31d28f2687a47e827a1e17300784a2c44 (diff) | |
download | qemu-039d4e3df0049bdd8f93a2de735a816483b13954.zip qemu-039d4e3df0049bdd8f93a2de735a816483b13954.tar.gz qemu-039d4e3df0049bdd8f93a2de735a816483b13954.tar.bz2 |
scsi: Address spurious clang warning
Some versions of Clang prior to 6.0 (and some builds of clang after,
such as 6.0.1-2.fc28) fail to recognize { 0 } as a valid initializer
for a struct with subobjects when -Wmissing-braces is enabled.
https://bugs.llvm.org/show_bug.cgi?id=21689 and
https://reviews.llvm.org/rL314499 suggests this should be fixed in 6.0,
but it might not be the case for older versions or downstream versions.
For now, follow the precedent of ebf2a499 and replace the standard { 0 }
with the accepted { } to silence this warning and allow the build to
work under clang 6.0.1-2.fc28, and builds prior to 6.0.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20181127184929.20065-1-jsnow@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | scsi/qemu-pr-helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index ce40008..e7af637 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -236,7 +236,7 @@ static void dm_init(void) perror("Cannot open " CONTROL_PATH); exit(1); } - struct dm_ioctl dm = { 0 }; + struct dm_ioctl dm = { }; if (!dm_ioctl(DM_VERSION, &dm)) { perror("ioctl"); exit(1); |