From d5475a58a1a3cb7f0e5154e49cd7f94d1038a7d0 Mon Sep 17 00:00:00 2001 From: Wanja Vogel Date: Wed, 10 Jun 2020 07:47:50 +0200 Subject: [PATCH] fix: avoid warning warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2). --- src/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os.c b/src/os.c index f33cfbc3..f7d5f7b1 100644 --- a/src/os.c +++ b/src/os.c @@ -1036,7 +1036,7 @@ static size_t mi_os_numa_nodex() { static size_t mi_os_numa_node_countx(void) { ULONG numa_max = 0; GetNumaHighestNodeNumber(&numa_max); - return (numa_max + 1); + return ((size_t)numa_max + 1); } #elif defined(__linux__) #include // getcpu