From de96ca95a6949e1c76bfa990b35c5d4341a1b290 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 18 May 2016 10:33:37 -0300 Subject: [PATCH] CPUInfo: cast result of sizeof to unsigned long That fix works when size_t is 32 or 64 bits. --- Tools/CPUInfo/CPUInfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tools/CPUInfo/CPUInfo.cpp b/Tools/CPUInfo/CPUInfo.cpp index 170872a8c4..6719ebcb10 100644 --- a/Tools/CPUInfo/CPUInfo.cpp +++ b/Tools/CPUInfo/CPUInfo.cpp @@ -18,13 +18,13 @@ void setup() { static void show_sizes(void) { hal.console->println("Type sizes:"); - 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("char : %lu\n", (unsigned long)sizeof(char)); + hal.console->printf("short : %lu\n", (unsigned long)sizeof(short)); + hal.console->printf("int : %lu\n", (unsigned long)sizeof(int)); + hal.console->printf("long : %lu\n", (unsigned long)sizeof(long)); + hal.console->printf("long long : %lu\n", (unsigned long)sizeof(long long)); + hal.console->printf("bool : %lu\n", (unsigned long)sizeof(bool)); + hal.console->printf("void* : %lu\n", (unsigned long)sizeof(void *)); hal.console->printf("printing NaN: %f\n", sqrt(-1.0f)); hal.console->printf("printing +Inf: %f\n", 1.0f/0.0f);