From f4272deea5ddd0600e95cce31904418ee9b9d1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 4 Mar 2020 13:56:52 +0200 Subject: [PATCH] test: Avoid a warning about a cast to a smaller integer type on 64 bit architectures --- test/hello-tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hello-tls.c b/test/hello-tls.c index c560233..cacc270 100644 --- a/test/hello-tls.c +++ b/test/hello-tls.c @@ -19,6 +19,7 @@ #include #include #include +#include #if defined(_MSC_VER) static __declspec(thread) int tlsvar = 1; @@ -27,7 +28,7 @@ static __thread int tlsvar = 1; #endif static unsigned __stdcall threadfunc(void* arg) { - int id = (int)arg; + int id = (int)(intptr_t)arg; printf("thread %d, tlsvar %p initially %d\n", id, &tlsvar, tlsvar); tlsvar = id + 100; for (int i = 0; i < 4; i++) {