[Libwebsockets] master - uint64_t format conversion failure

Michael Haberler mail17 at mah.priv.at
Mon Dec 1 23:57:04 CET 2014


gcc 4.7.2 complains:


[ 52%] Building C object CMakeFiles/test-ping.dir/test-server/test-ping.c.o
/home/mah/src/libwebsockets-warmcat/test-server/test-ping.c: In function ‘callback_lws_mirror’:
/home/mah/src/libwebsockets-warmcat/test-server/test-ping.c:193:11: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ [-Werror=format]
/home/mah/src/libwebsockets-warmcat/test-server/test-ping.c:216:4: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ [-Werror=format]
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/test-ping.dir/test-server/test-ping.c.o] Error 1
make[1]: *** [CMakeFiles/test-ping.dir/all] Error 2
make: *** [all] Error 2

tentative patch: https://github.com/mhaberler/libwebsockets/commit/4cab125445b85ac3d4e375ad87c512cf36059a56

not sure about Windows applicability, it might mean we need to emply __STDC_FORMAT_MACROS  like here: http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t


- Michael







More information about the Libwebsockets mailing list