aakash-sahai / nanopb

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

pb_decode.c:366:69: error: invalid conversion from ‘const void*’ to ‘const pb_field_t* {aka const _pb_field_t*}’ [-fpermissive] #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compiling pb_decode.c with g++ (not gcc) -Wall results in a few casting 
warnings.  Here's one:

pb_decode.c: In function ‘void pb_message_set_to_defaults(const pb_field_t*, 
void*)’:
pb_decode.c:394:69: error: invalid conversion from ‘const void*’ to 
‘const pb_field_t* {aka const _pb_field_t*}’ [-fpermissive]
pb_decode.c:396:13: error:   initializing argument 1 of ‘void 
pb_message_set_to_defaults(const pb_field_t*, void*)’ [-fpermissive]

I made a few changes here:

http://code.google.com/r/stanhu-gplusplus-warning-fixes/source/diff?spec=svn07a2
276b838cbf6f59b55e595f4cac70afd24e29&r=07a2276b838cbf6f59b55e595f4cac70afd24e29&
format=side&path=/pb_decode.c

Original issue reported on code.google.com by sta...@gmail.com on 16 Aug 2012 at 6:33

GoogleCodeExporter commented 9 years ago
Thanks, merged:
http://code.google.com/p/nanopb/source/detail?r=07f24f9b7022086187f60f52e786d0db
dbd3b7f1

Not sure about the trailing whitespace stuff in your other commits; what does 
it matter?

Original comment by Petteri.Aimonen on 16 Aug 2012 at 7:07

GoogleCodeExporter commented 9 years ago
Thanks.  The trailing whitespace doesn't really matter to the compiler, but 
it's just annoying to compare a diff that has lots of whitespace changes.  My 
editor automatically removes them (as per coding style specified by 
http://www.kernel.org/doc/Documentation/CodingStyle).

Original comment by sta...@gmail.com on 16 Aug 2012 at 8:36

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

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