Hello, When compiling the enclosed source code (see attachment), I get the following warnings from GCC: -------- test.c: In function `main': test.c:15: warning: missing initializer test.c:15: warning: (near initialization for `my_struct.var1') -------- When trying the suggestion (something I read on http://bytes.com/forum/thread212987.html) of adding braces around `{0}' to make it `{{0}}', GCC gives me the following warnings: -------- test.c: In function `main': test.c:15: warning: braces around scalar initializer test.c:15: warning: (near initialization for `my_struct.var0') test.c:15: warning: missing initializer test.c:15: warning: (near initialization for `my_struct.var1') -------- What is the correct way to easily initialize a struct and all it's members (recursively perhaps?) to zero? I read that `= {0}' is valid code and shouldn't need to be changed. I'm unsure whether this is true. Thanks in advance, Jelle Geerts
Attachment:
test.c
Description: Binary data