named-data-iot / ndn-riot

NDN stack module for RIOT-OS
9 stars 8 forks source link

Debugging type error for ndn-riot/encoding/data.c during flashing #10

Open Burdaa opened 6 years ago

Burdaa commented 6 years ago

Errors while flashing Zolertia Re-Mote (remote-reva). Fixed by changing all afflicted lines from (%u) to (%" PRIu32"). Is this correct, or is it a bug on my part? Ubuntu 16.04 Zolertia Re-Mote

In file included from /home/martin/dev/riot/ndn-riot/encoding/data.c:21:0:
/home/martin/dev/riot/ndn-riot/encoding/data.c: In function 'ndn_data_verify_signature':
/home/martin/dev/riot/ndn-riot/encoding/data.c:898:23: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
                 DEBUG("ndn_encoding: invalid digest sig value length (%u)\n",
                       ^
/home/martin/dev/riot/RIOT/core/include/debug.h:56:20: note: in definition of macro 'DEBUG_PRINT'
             printf(__VA_ARGS__); \
                    ^~~~~~~~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:898:17: note: in expansion of macro 'DEBUG'
                 DEBUG("ndn_encoding: invalid digest sig value length (%u)\n",
                 ^~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:915:23: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
                 DEBUG("ndn_encoding: invalid hmac sig value length (%u)\n",
                       ^
/home/martin/dev/riot/RIOT/core/include/debug.h:56:20: note: in definition of macro 'DEBUG_PRINT'
             printf(__VA_ARGS__); \
                    ^~~~~~~~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:915:17: note: in expansion of macro 'DEBUG'
                 DEBUG("ndn_encoding: invalid hmac sig value length (%u)\n",
                 ^~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:937:23: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
                 DEBUG("ndn_encoding: invalid ecdsa sig value length (%u)\n",
                       ^
/home/martin/dev/riot/RIOT/core/include/debug.h:56:20: note: in definition of macro 'DEBUG_PRINT'
             printf(__VA_ARGS__); \
                    ^~~~~~~~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:937:17: note: in expansion of macro 'DEBUG'
                 DEBUG("ndn_encoding: invalid ecdsa sig value length (%u)\n",
                 ^~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c: In function 'ndn_data_decrypt_with_ccm':
/home/martin/dev/riot/ndn-riot/encoding/data.c:1007:15: error: format '%d' expects argument of type 'int', but argument 2 has type 'int32_t {aka long int}' [-Werror=format=]
         DEBUG("ndn_encoding: wrong content type %d for ccm data\n",
               ^
               metainfo.content_type);
               ~~~~~~~~~~
/home/martin/dev/riot/RIOT/core/include/debug.h:56:20: note: in definition of macro 'DEBUG_PRINT'
             printf(__VA_ARGS__); \
                    ^~~~~~~~~~~
/home/martin/dev/riot/ndn-riot/encoding/data.c:1007:9: note: in expansion of macro 'DEBUG'
         DEBUG("ndn_encoding: wrong content type %d for ccm data\n",
         ^~~~~
cc1: all warnings being treated as errors
astralien3000 commented 6 years ago

You are correct, PR #12 should fix that.