ufairiya / mongoose

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

Compiling Mongoose under x86_64 throughs ill format warnings. #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compiling Mongoose 2.8 (The TGZ package) under x86_64 throws the following
warnings ...

mongoose.c: In function ‘send_file’:
mongoose.c:2749: warning: format ‘%llu’ expects type ‘long long unsigned
int *’, but argument 3 has type ‘uint64_t *’
mongoose.c:2749: warning: format ‘%llu’ expects type ‘long long unsigned
int *’, but argument 4 has type ‘uint64_t *’
mongoose.c: In function ‘log_access’:
mongoose.c:3793: warning: format ‘%llu’ expects type ‘long long unsigned
int’, but argument 11 has type ‘uint64_t’

the fix for this is simply editing mongoose.c as follows ...

192: #define UINT64_FMT "ll"
// to ..
192: #define UINT64_FMT "j"

Original issue reported on code.google.com by amr.ali.cc on 24 Apr 2010 at 4:00

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks!
Couple of questions/notes:
  1. x86_64 is what? I assume, linux/gcc?
  2. Please do any patches/tests against the trunk, not version 2.8.
  3. Are you sure your change is correct for 32-bit platforms?

Original comment by valenok on 24 Apr 2010 at 6:36

GoogleCodeExporter commented 9 years ago
(1) Yes it is Linux/GCC.
(2) I will do so, as a matter of fact I'm embedding Mongoose into my project 
which I
need a REST interface for. So does the trunk contains a stable code that can be
effectively used right away or does it just contain the nightly updates?
(3) Yes I've tested it with the example you provided in examples/example.c.

To test against x86 32bit do provide a "-m32" flag to GCC as follows ...

gcc -m32 -ldl -lpthread -I. mongoose.c example/examples.c -o example

Original comment by amr.ali.cc on 27 Apr 2010 at 12:48

GoogleCodeExporter commented 9 years ago
The man page says:
"j      A following integer conversion corresponds to an intmax_t or uintmax_t 
argument."

Are you sure that intmax_t on 32-bit platform can hold 64 bit value?

Original comment by valenok on 27 Apr 2010 at 8:32

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 6 Sep 2010 at 10:07