diff mbox series

[nft,4/5] xt: avoid "-Wmissing-field-initializers" for "original_opts"

Message ID 20230829185509.374614-5-thaller@redhat.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series fix compiler warnings with clang and "-Wextra" | expand

Commit Message

Thomas Haller Aug. 29, 2023, 6:54 p.m. UTC
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>
---
 src/xt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/xt.c b/src/xt.c
index df7140b4fa97..a217cc7b6bd0 100644
--- 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 = {