Closed GoogleCodeExporter closed 9 years ago
I fully agree.
When compiling current master branch code under G++ with -Wcast-qual switch,
there are plenty of warning in pb_encode.c and one in pb_decode.c stating that
const qualifier is discarded.
E.g.:
(...)\pb_encode.c: In function 'pb_encode':
(...)\pb_encode.c:171:22: warning: cast discards '__attribute__((const))'
qualifier from pointer target type [-Wcast-qual]
I guess all of them can be easily 'fixed' by using const declarations.
Original comment by Adam.Cha...@gmail.com
on 26 Aug 2012 at 12:03
This issue was updated by revision a06dba6e49a7.
Original comment by Petteri.Aimonen
on 26 Aug 2012 at 12:22
Ah, good to know about -Wcast-qual. I fixed the warnings and added it to the
tests/Makefile for the library core. It helps to catch any mistaken writes to
structure in the encoder.
Apparently there wasn't that much to fix for C++ compilation, but now that is
also part of the test set.
Original comment by Petteri.Aimonen
on 26 Aug 2012 at 12:25
Fix released in nanopb-0.1.6.
Original comment by Petteri.Aimonen
on 3 Sep 2012 at 5:46
Original issue reported on code.google.com by
Petteri.Aimonen
on 24 Aug 2012 at 6:36