From 0d0766fbe57495d23858263e86daaa3404e52e9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 19 May 2023 16:47:48 +0200 Subject: [PATCH] test_uuidd: make pthread_t formatting more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On musl pthread_t is a pointer. To avoid compiler warnings on 32bit systems add a cast through intptr_t. Signed-off-by: Thomas Weißschuh --- misc-utils/test_uuidd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc-utils/test_uuidd.c b/misc-utils/test_uuidd.c index 779b28dfde..f012a2cf7b 100644 --- a/misc-utils/test_uuidd.c +++ b/misc-utils/test_uuidd.c @@ -184,7 +184,7 @@ static void create_nthreads(process_t *proc, size_t index) } LOG(2, (stderr, "%d: started thread [tid=%jd,index=%zu]\n", - proc->pid, (intmax_t) th->tid, th->index)); + proc->pid, (intmax_t) (intptr_t) th->tid, th->index)); index += nobjects; ncreated++; } @@ -204,7 +204,7 @@ static void create_nthreads(process_t *proc, size_t index) } LOG(2, (stderr, "%d: thread exited [tid=%jd,return=%d]\n", - proc->pid, (intmax_t) th->tid, th->retval)); + proc->pid, (intmax_t) (intptr_t) th->tid, th->retval)); } free(threads); @@ -260,7 +260,7 @@ static void object_dump(size_t idx, object_t *obj) fprintf(stderr, " uuid: <%s>\n", p); fprintf(stderr, " idx: %zu\n", obj->idx); fprintf(stderr, " process: %d\n", (int) obj->pid); - fprintf(stderr, " thread: %jd\n", (intmax_t) obj->tid); + fprintf(stderr, " thread: %jd\n", (intmax_t) (intptr_t) obj->tid); fprintf(stderr, "}\n"); } -- 2.47.3