Using nRF51 SDK 10.0, it seems like many debug prints are incorrect, triggering a GCC format warning resulting in a compilation error with -Wall turned on.
A workaround is turning the warnings off, but that is a bad solution.
Please fix the debug format strings so that GCC need not warn us anymore, example:
error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format=]
DM_TRC("[DM]: Initializing Application Instance 0x%08X.\r\n", index);
Hi, this issue has been reported internally. Unfortunately, I think the simplest workaround for now is to disable the warning flag in your makefile while debugging as you mentioned.
Note that the [-Werror=format=] at the end of the message tells you the command-line option to disable just this specific warning ...
Adding CFLAGS += -Wformat=0 to the makefile ignores the warnings and works around the issue for now.
Hi, PRIx32 definition from inttypes.h header is the portable way to printf uint32_t type:
DM_TRC("[DM]: Initializing Application Instance 0x%08"PRIx32".\r\n", index);