aakash-sahai / nanopb

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

Example fails to compile on 64-bit Linux with GCC 4.6: %lld to print int64_t causes error #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$ make -C example
...
client.c:33:5: error: format ‘%lld’ expects argument of type ‘long long 
int’, but argument 2 has type ‘uint64_t’ [-Werror=format]
...
$

Cast'ing integer to uintmax_t and using %ju instead fixes this problem.

nanopb 0.1.2

Original issue reported on code.google.com by mikhail....@gmail.com on 19 May 2012 at 6:11

GoogleCodeExporter commented 9 years ago
Fixed:
http://code.google.com/p/nanopb/source/detail?r=b94329088691538004f745a28e568d5a
e1fba456

I used cast to (long long) instead.. just in case some platform might not 
support %ju in printf.

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