]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
xt: avoid "-Wmissing-field-initializers" for "original_opts"
authorThomas Haller <thaller@redhat.com>
Tue, 29 Aug 2023 18:54:10 +0000 (20:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 30 Aug 2023 07:47:12 +0000 (09:47 +0200)
Avoid this warning with clang:

      CC       src/xt.lo
    src/xt.c:353:9: error: missing field 'has_arg' initializer [-Werror,-Wmissing-field-initializers]
            { NULL },
                   ^

The warning seems not very useful, because it's well understood that
specifying only some initializers leaves the remaining fields
initialized with the default. However, as this warning is only hit once
in the code base, it doesn't seem that we violate this style frequently.
Hence, fix it instead of disabling the warning.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/xt.c

index df7140b4fa977cd66e5a2a02bd3f5fef0c6873ef..a217cc7b6bd0c04d3fecaa57cde50146bf44a85f 100644 (file)
--- a/src/xt.c
+++ b/src/xt.c
@@ -350,7 +350,7 @@ err:
 }
 
 static struct option original_opts[] = {
-       { NULL },
+       { },
 };
 
 static struct xtables_globals xt_nft_globals = {