From 8ce2783b4bc6d4507232362430554c6462790ce6 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Tue, 15 Jan 2019 11:30:32 -0500 Subject: [PATCH] Correct a format string Use a format string macro from inttypes.h when printfing thread IDs on non-Windows, non-Linux platforms. This silences a -Wformat trigger when cross-compiling for macOS. --- src/core/lib/gpr/log_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc index 0acb2255724..b6edc14ab6b 100644 --- a/src/core/lib/gpr/log_posix.cc +++ b/src/core/lib/gpr/log_posix.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,7 @@ void gpr_default_log(gpr_log_func_args* args) { } char* prefix; - gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]", + gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]", gpr_log_severity_string(args->severity), time_buffer, (int)(now.tv_nsec), gettid(), display_file, args->line);