unwireddevices / lora-mqtt

Translator between binary LoRa application layer and MQTT broker
5 stars 6 forks source link

Warnings during compile in Ubuntu #6

Closed tatyanavolkova closed 6 years ago

tatyanavolkova commented 6 years ago

Of course I can fix this by removing the -Werror directive, but this is not correct!

Ubuntu 16.04 on desktop PC:

gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: bab7da148afbe213714f0f38814b36b0 modules/umdk-irblaster.c: In function ‘umdk_irblaster_command’: modules/umdk-irblaster.c:58:32: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Werror=format=] snprintf(out, bufsize, "%02x%02x%s", UMDK_IR_CMD_SEND, strlen(hex)/2, h ^ modules/umdk-irblaster.c:58:32: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Werror=format=] cc1: all warnings being treated as errors Makefile:158: ошибка выполнения рецепта для цели «bin/modules/umdk-irblaster.o» make: *** [bin/modules/umdk-irblaster.o] Ошибка 1

Ubuntu 16.04 on Artik computer (aarch64):

GNU C11 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.10) version 5.4.0 20160609 (aarch64-linux-gnu) compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=95 --param ggc-min-heapsize=122651 Compiler executable checksum: b880bfd7251403c82cbaec640be58083 modules/umdk-pacs.c: In function ‘umdk_pacs_command’: modules/umdk-pacs.c:64:26: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] snprintf(out, bufsize, "%02x%016llx%04x", UMDK_PACS_CMD_ADD_ID, id, time); ^ modules/umdk-pacs.c:64:26: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] modules/umdk-pacs.c:69:26: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] snprintf(out, bufsize, "%02x%016llx", UMDK_PACS_CMD_REMOVE_ID, id); ^ modules/umdk-pacs.c:69:26: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] modules/umdk-pacs.c: In function ‘umdk_pacs_reply’: modules/umdk-pacs.c:91:29: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] snprintf(buf, sizeof(buf), "%016llX", *id); ^ modules/umdk-pacs.c:91:29: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Werror=format=] cc1: all warnings being treated as errors Makefile:158: recipe for target 'bin/modules/umdk-pacs.o' failed make: *** [bin/modules/umdk-pacs.o] Error 1

olegart commented 6 years ago

Fixed