[riot-notifications] [RIOT-OS/RIOT] sys/shell: add heap command (#10953)

Gunar Schorcht notifications at github.com
Thu Sep 5 12:19:16 CEST 2019


Hm ... wierd
```
Running './dist/tools/cppcheck/check.sh'
	cpu/esp32/syscalls.c:238: portability (invalidPrintfArgType_uint): %u in format string (no. 1) requires 'unsigned int' but the argument type is 'size_t {aka unsigned long}'.
```
Here, `cppcheck` and `gcc` have different opinions. When I change the format string to `%lu` as `cppcheck` requires, the compiler complains:
```
cpu/esp32/syscalls.c:238:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t {aka unsigned int}' [-Werror=format=]
     printf("heap: %lu (used %lu free %lu) [bytes]\n",
```
So, `cppcheck` suppose that `size_t` is unsigned long while `gcc` says it is unsigned int.

I could solve it only by hard casting data types. But casting to `unsigned int` on a 32 platform with 32 bit integer size should be OK in any case since could address 4 GByte with it.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10953#issuecomment-528299137
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190905/23b2004d/attachment.htm>


More information about the notifications mailing list