[PATCH v2] tools: Fix compilation with Clang 6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clang 6 doesn't like the way the last item in a GOptionEntry
array is initialized:

  ../../tools/osinfo-install-script.c:87:12: error: missing field
  'short_name' initializer [-Werror,-Wmissing-field-initializers]
      { NULL }
             ^
  1 error generated.
  gmake[2]: *** [Makefile:540: osinfo-install-script.o] Error 1
  gmake[2]: *** Waiting for unfinished jobs....
  ../../tools/osinfo-detect.c:104:12: error: missing field
  'short_name' initializer [-Werror,-Wmissing-field-initializers]
      { NULL }
             ^
  1 error generated.
  gmake[2]: *** [Makefile:540: osinfo-detect.o] Error 1

Fix the issue by using the { 0 } initializer instead.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 tools/osinfo-detect.c         | 2 +-
 tools/osinfo-install-script.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c
index 2e5af97..c6fb36f 100644
--- a/tools/osinfo-detect.c
+++ b/tools/osinfo-detect.c
@@ -101,7 +101,7 @@ static GOptionEntry entries[] =
       G_OPTION_ARG_CALLBACK, parse_type_str,
       N_("URL type. Default: media"),
       N_("media|tree.") },
-    { NULL }
+    { 0 }
 };
 
 static void print_bootable(gboolean bootable)
diff --git a/tools/osinfo-install-script.c b/tools/osinfo-install-script.c
index 75bfda1..3535022 100644
--- a/tools/osinfo-install-script.c
+++ b/tools/osinfo-install-script.c
@@ -84,7 +84,7 @@ static GOptionEntry entries[] =
       (void*)&list_inj_method, N_("List supported injection methods"), NULL },
     { "quiet", 'q', 0, G_OPTION_ARG_NONE, (void*)&quiet,
       N_("Do not display output filenames"), NULL },
-    { NULL }
+    { 0 }
 };
 
 
-- 
2.17.0

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux