From 99be590cb9b492825dd2cc453efc23d852594d16 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Tue, 4 Apr 2023 07:48:33 +0800 Subject: [PATCH] [compiler-rt] Fix -Wformat in timing.h (NFC) /home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:181:41: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat] Str.append("%14llu.%llu(ns) %-11s", Integral, Fraction, " "); ~~~~~~ ^~~~~~~~ %14lu /home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:181:51: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat] Str.append("%14llu.%llu(ns) %-11s", Integral, Fraction, " "); ~~~~ ^~~~~~~~ %lu /home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:185:54: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat] Str.append("%s (%llu)\n", Timers[HandleId].Name, Occurrence); ~~~~ ^~~~~~~~~~ %lu 3 errors generated. --- compiler-rt/lib/scudo/standalone/timing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/scudo/standalone/timing.h b/compiler-rt/lib/scudo/standalone/timing.h index 29eb894fa0a05..c457e96214149 100644 --- a/compiler-rt/lib/scudo/standalone/timing.h +++ b/compiler-rt/lib/scudo/standalone/timing.h @@ -178,11 +178,11 @@ class TimingManager { Occurrence == 0 ? 0 : ((AccumulatedTime % Occurrence) * 10) / Occurrence; - Str.append("%14llu.%llu(ns) %-11s", Integral, Fraction, " "); + Str.append("%14lu.%lu(ns) %-11s", Integral, Fraction, " "); for (u32 I = 0; I < ExtraIndent; ++I) Str.append("%s", " "); - Str.append("%s (%llu)\n", Timers[HandleId].Name, Occurrence); + Str.append("%s (%lu)\n", Timers[HandleId].Name, Occurrence); for (u32 I = 0; I < NumAllocatedTimers; ++I) if (Timers[I].Nesting == HandleId)