From 1b6ff36c2f506a3b939411e322f4c9f51d33c7d6 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Sun, 11 Mar 2018 19:27:22 +0400 Subject: [PATCH] Fix build with clang 6.0.0 Clang 6.0.0 complains when initializing structure with { NULL }: conf/domain_addr.c:1494:38: error: missing field 'type' initializer [-Werror,-Wmissing-field-initializers] virDomainDeviceInfo nfo = { NULL }; Use { 0 } instead to make it happy. Signed-off-by: Roman Bogorodskiy Reviewed-by: Michal Privoznik --- src/conf/domain_addr.c | 2 +- tests/sysinfotest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 5e875a3e6e..0c914fe25c 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -1491,7 +1491,7 @@ virDomainVirtioSerialAddrAssign(virDomainDefPtr def, bool portOnly) { int ret = -1; - virDomainDeviceInfo nfo = { NULL }; + virDomainDeviceInfo nfo = { 0 }; virDomainDeviceInfoPtr ptr = allowZero ? &nfo : info; ptr->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL; diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index a61da017c9..53d5725fd2 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -91,7 +91,7 @@ sysinfotest_run(const char *test, const char *cpuinfo, const char *expected) { - struct testSysinfoData testdata = { NULL }; + struct testSysinfoData testdata = { 0 }; int ret = EXIT_FAILURE; testdata.func = func; -- GitLab