aakash-sahai / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Missing initializer caused by PB_LAST_FIELD #define #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When you use the gcc options -Wall and -Wextra, you get this warning.

generated.pb.c:55: warning: missing initializer
generated.pb.c:55: warning: (near initialization for 
‘MessageType_fields[8].data_size’)

The problem is caused by 

#define PB_LAST_FIELD {0,(pb_type_t) 0,0,0}

struct _pb_field_t has 7 fields, so instead the define should be.

#define PB_LAST_FIELD {0,(pb_type_t)0,0,0,0,0,0}

Original issue reported on code.google.com by jone...@jonesmz.com on 31 Aug 2012 at 9:19

GoogleCodeExporter commented 9 years ago

Original comment by Petteri.Aimonen on 1 Sep 2012 at 7:49

GoogleCodeExporter commented 9 years ago
This issue was updated by revision f187aad63db2.

Original comment by Petteri.Aimonen on 2 Sep 2012 at 4:55

GoogleCodeExporter commented 9 years ago
Fix released in nanopb-0.1.6.

Original comment by Petteri.Aimonen on 3 Sep 2012 at 5:46