From: Thomas Weißschuh Date: Fri, 19 May 2023 14:47:48 +0000 (+0200) Subject: test_uuidd: make pthread_t formatting more robust X-Git-Tag: v2.40-rc1~448^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf652a72780452f67e39c584f3cd83c891cd0e33;p=thirdparty%2Futil-linux.git test_uuidd: make pthread_t formatting more robust 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 --- 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"); }