[Libosinfo] [PATCH v2] tools: Fix compilation with Clang 6

Fabiano Fidêncio fabiano at fidencio.org
Sat May 12 10:21:09 UTC 2018


On Fri, May 11, 2018 at 5:41 PM, Andrea Bolognani <abologna at redhat.com> wrote:
> 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 at redhat.com>
> ---
>  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 at redhat.com
> https://www.redhat.com/mailman/listinfo/libosinfo


Ack!
-- 
Fabiano Fidêncio




More information about the Libosinfo mailing list