From: Darrick J. Wong With -Wformat enabled, the e2fsprogs build spews out a lot of warnings for fuse2fs: ../../misc/fuse2fs.c: In function ‘__fuse2fs_finish’: ../../misc/fuse2fs.c:152:24: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=] 152 | printf("FUSE2FS (%s): tid=%llu " format, (fuse2fs)->shortdev, get_thread_id(), ##__VA_ARGS__); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ | | | uint64_t {aka long unsigned int} ../../misc/fuse2fs.c:556:17: note: in expansion of macro ‘dbg_printf’ 556 | dbg_printf(ff, "%s: libfuse ret=%d\n", func, ret); | ^~~~~~~~~~ Because the linter doesn't like mixing %llu with a uint64_t type. On some platforms, uint64_t is merely "unsigned long" and whiiiiine. Since this is a new wrapper function, let's change the return type. Signed-off-by: "Darrick J. Wong" --- lib/support/thread.h | 2 +- lib/support/thread.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/support/thread.h b/lib/support/thread.h index 9a7f5c9db1b7a2..efba1c3b1eec0b 100644 --- a/lib/support/thread.h +++ b/lib/support/thread.h @@ -2,4 +2,4 @@ * thread.h -- header file for thread utilities */ -uint64_t get_thread_id(void); +unsigned long long get_thread_id(void); diff --git a/lib/support/thread.c b/lib/support/thread.c index a9a10940c0fd3e..651be1cf833860 100644 --- a/lib/support/thread.c +++ b/lib/support/thread.c @@ -12,7 +12,7 @@ #include "support/thread.h" -uint64_t get_thread_id(void) +unsigned long long get_thread_id(void) { #if defined(HAVE_GETTID) return gettid(); @@ -22,7 +22,7 @@ uint64_t get_thread_id(void) if (pthread_threadid_np(NULL, &tid)) return tid; #elif defined(HAVE_PTHREAD) - return (__u64)(uintptr_t) pthread_self(); + return (unsigned long long)(uintptr_t) pthread_self(); #endif return getpid(); }