aakash-sahai / nanopb

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

Empty initializer { } doesn't work on all compilers #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Atleast MSVC 6.0 errors out on

uint32_t foobar[4] = {};

and similar. Change to use {0}.

Original issue reported on code.google.com by Petteri.Aimonen on 11 Jul 2012 at 5:00

GoogleCodeExporter commented 9 years ago
Note: add -pedantic in addition to -ansi to detect these issues automatically.

Original comment by Petteri.Aimonen on 11 Jul 2012 at 5:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached a patch that fixes this, and another compiler warning re signed / 
unsigned mismatch.

Original comment by david.ho...@googlemail.com on 16 Jul 2012 at 10:13

Attachments:

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/nanopb/source/detail?r=8524de39ce2e4c369ed1051c7ed2e4cd
43ad321d
http://code.google.com/p/nanopb/source/detail?r=10b5da12dc9757b345a9d6f9daeef909
8731ff69

Original comment by Petteri.Aimonen on 18 Jul 2012 at 6:22

GoogleCodeExporter commented 9 years ago
Thanks - but it looks as though you missed this change:

-static bool checkreturn pb_field_find(pb_field_iterator_t *iter, int tag)
+static bool checkreturn pb_field_find(pb_field_iterator_t *iter, uint32_t tag)

I guess this was an accident?

Original comment by david.ho...@googlemail.com on 18 Jul 2012 at 7:37

GoogleCodeExporter commented 9 years ago
Ah, so I did. For some reason GCC doesn't warn about those.

Fixed now:
http://code.google.com/p/nanopb/source/detail?r=0a5b6852ec34a9b954503e707f5fe71d
f37638ce

Original comment by Petteri.Aimonen on 19 Jul 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Great - thanks.

Original comment by david.ho...@googlemail.com on 19 Jul 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Fix included in 0.1.5

Original comment by Petteri.Aimonen on 6 Aug 2012 at 8:18