mlfazevedo / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Invalid format specifier on debug output #350

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In mg_read(..):
On line DEBUG_TRACE(("%p %zu %lld %lld", ..):

Should be %u instead of %zu

A patch is attached.

Original issue reported on code.google.com by nullable...@gmail.com on 6 May 2012 at 7:43

Attachments:

GoogleCodeExporter commented 8 years ago
%zu is not a bug but a (C99) feature:

http://stackoverflow.com/questions/2524611/how-to-print-size-t-variable-portably

Note that C89 portable code might do a thing similar to using the INT64_FMT 
#define (or simpler: cast the size_t to an unsigned long int and then printf it 
using %lu)

Original comment by ger.hobbelt on 12 May 2012 at 5:46

GoogleCodeExporter commented 8 years ago
Ok, i see. Unfortunatley the MS compiler doesn't support C99.

Original comment by nullable...@gmail.com on 13 May 2012 at 9:34

GoogleCodeExporter commented 8 years ago
Submitted 
https://github.com/valenok/mongoose/commit/6add727c722e11c70c9985586519aff3f3d3b
fd6, thanks

Original comment by valenok on 16 Aug 2012 at 10:34