From a6440b0fc535f660334cb48ca002e2fb34f5c4b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Tue, 8 Nov 2022 11:45:41 +0200 Subject: [PATCH] [openmp] [test] Fix warnings about printf format mismatches on Windows This fixes warnings like this: ``` openmp/runtime/test/omp_testsuite.h:107:60: warning: format specifies type 'unsigned int' but the argument has type 'DWORD' (aka 'unsigned long') [-Wformat] fprintf(stderr, "CreateThread() failed: Error #%u.\n", GetLastError()); ~~ ^~~~~~~~~~~~~~ %lu ``` Differential Revision: https://reviews.llvm.org/D137747 --- openmp/runtime/test/omp_testsuite.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openmp/runtime/test/omp_testsuite.h b/openmp/runtime/test/omp_testsuite.h index b1dcf8f..ef2ae20 100644 --- a/openmp/runtime/test/omp_testsuite.h +++ b/openmp/runtime/test/omp_testsuite.h @@ -104,7 +104,8 @@ static int pthread_create(pthread_t *thread, void *attr, info->arg = arg; pthread = CreateThread(NULL, 0, __thread_func_wrapper, info, 0, NULL); if (pthread == NULL) { - fprintf(stderr, "CreateThread() failed: Error #%u.\n", GetLastError()); + fprintf(stderr, "CreateThread() failed: Error #%u.\n", + (unsigned) GetLastError()); exit(1); } *thread = pthread; @@ -116,12 +117,13 @@ static int pthread_join(pthread_t thread, void **retval) { rc = WaitForSingleObject(thread, INFINITE); if (rc == WAIT_FAILED) { fprintf(stderr, "WaitForSingleObject() failed: Error #%u.\n", - GetLastError()); + (unsigned) GetLastError()); exit(1); } rc = CloseHandle(thread); if (rc == 0) { - fprintf(stderr, "CloseHandle() failed: Error #%u.\n", GetLastError()); + fprintf(stderr, "CloseHandle() failed: Error #%u.\n", + (unsigned) GetLastError()); exit(1); } return 0; -- 2.7.4