From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] qemu-pr-helper: Do not use {0} for initialization
Date: Fri, 20 Oct 2017 13:21:21 +0200 [thread overview]
Message-ID: <20171020112121.12321-1-pbonzini@redhat.com> (raw)
The first field in struct dm_ioctl is an array, and old GCC warns
about it with -Wmissing-braces (GCC <= 4.8). The "{0}" universal
zero initializer is only useful if the other side might be a scalar;
for a struct, "{}" is enough and shuts up the compiler.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scsi/qemu-pr-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index dd9785143b..8e475f676e 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -258,12 +258,12 @@ static void *dm_dev_ioctl(int fd, int ioc, struct dm_ioctl *dm)
static void dm_init(void)
{
+ struct dm_ioctl dm = {};
control_fd = open(CONTROL_PATH, O_RDWR);
if (control_fd < 0) {
perror("Cannot open " CONTROL_PATH);
exit(1);
}
- struct dm_ioctl dm = { 0 };
if (!dm_ioctl(DM_VERSION, &dm)) {
perror("ioctl");
exit(1);
--
2.14.2
next reply other threads:[~2017-10-20 11:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 11:21 Paolo Bonzini [this message]
2017-10-23 17:05 ` [Qemu-devel] [PATCH] qemu-pr-helper: Do not use {0} for initialization Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171020112121.12321-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).