[PATCH obmc-console 2/2] console-server: fix initialiser

OpenBMC Patches openbmc-patches at stwcx.xyz
Fri Mar 18 17:30:28 AEDT 2016


From: Joel Stanley <joel at jms.id.au>

When using clang (3.8, and 3.4), the initaliser for struct option:

console-server.c:471:6: error: missing field 'has_arg' initializer
  [-Werror,-Wmissing-field-initializers]
        { 0 },

Shut the compiler up by using four zeros, which is what the libc manual
suggests:

 "Terminate the array with an element containing all zeros."

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 console-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/console-server.c b/console-server.c
index 3857de1..ddff1af 100644
--- a/console-server.c
+++ b/console-server.c
@@ -468,7 +468,7 @@ int run_console(struct console *console)
 }
 static const struct option options[] = {
 	{ "config",	required_argument,	0, 'c'},
-	{ 0 },
+	{ 0,  0, 0, 0},
 };
 
 int main(int argc, char **argv)
-- 
2.7.1




More information about the openbmc mailing list