Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCC missing braces around initializer

Tags:

c

gcc

gcc-warning

I have this struct in C below that I want to initialize to all zero. How do I get rid of the missing braces warning?

typedef struct {     uint32_t incoming[FRAME_TYPE_MAX];     uint32_t outgoing[FRAME_TYPE_MAX];     uint32_t timeouts;     uint32_t crc_errors; } pkt_t;  static pkt_t stats = {0}; 
like image 443
fred basset Avatar asked Jul 18 '12 23:07

fred basset


1 Answers

This is GCC bug # 53119:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

If you want to see it fixed, post a followup to the bug report indicating that it's a problem for you.

like image 113
R.. GitHub STOP HELPING ICE Avatar answered Oct 23 '22 08:10

R.. GitHub STOP HELPING ICE