Tools: CPUInfo: fix warnings on printf

../../Tools/CPUInfo/CPUInfo.cpp:21:54: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
  hal.console->printf("char      : %d\n", sizeof(char));
                                                      ^
And so on.

Ideally for sizeof() which returns size_t we would use %zu, but that's not
implemented by our version of printf. So use %lu which should be ok in all of
our boards.
This commit is contained in:
Lucas De Marchi 2016-05-03 22:17:53 -03:00
parent 2c029ae1f9
commit c82f28f35a
1 changed files with 7 additions and 7 deletions

View File

@ -18,13 +18,13 @@ void setup() {
static void show_sizes(void)
{
hal.console->println("Type sizes:");
hal.console->printf("char : %d\n", sizeof(char));
hal.console->printf("short : %d\n", sizeof(short));
hal.console->printf("int : %d\n", sizeof(int));
hal.console->printf("long : %d\n", sizeof(long));
hal.console->printf("long long : %d\n", sizeof(long long));
hal.console->printf("bool : %d\n", sizeof(bool));
hal.console->printf("void* : %d\n", sizeof(void *));
hal.console->printf("char : %lu\n", sizeof(char));
hal.console->printf("short : %lu\n", sizeof(short));
hal.console->printf("int : %lu\n", sizeof(int));
hal.console->printf("long : %lu\n", sizeof(long));
hal.console->printf("long long : %lu\n", sizeof(long long));
hal.console->printf("bool : %lu\n", sizeof(bool));
hal.console->printf("void* : %lu\n", sizeof(void *));
hal.console->printf("printing NaN: %f\n", sqrt(-1.0f));
hal.console->printf("printing +Inf: %f\n", 1.0f/0.0f);