Skip to content

Commit

Permalink
[compiler-rt] Fix -Wformat in timing.h (NFC)
Browse files Browse the repository at this point in the history
/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.
  • Loading branch information
DamonFool committed Apr 3, 2023
1 parent be15db8 commit 99be590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/scudo/standalone/timing.h
Expand Up @@ -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)
Expand Down

0 comments on commit 99be590

Please sign in to comment.