stack_depot.h
stats.h
string_utils.h
- # TODO(chiahungduan): Temporarily disable the timer because of the print
- # of u64 has incorrect placeholder.
- # timing.h
+ timing.h
tsd_exclusive.h
tsd_shared.h
tsd.h
report.cpp
rss_limit_checker.cpp
string_utils.cpp
- # TODO(chiahungduan): Temporarily disable the timer because of the print
- # of u64 has incorrect placeholder.
- # timing.cpp
+ timing.cpp
)
# Enable the necessary instruction set for scudo_crc32.cpp, if available.
appendChar(&Buffer, BufferEnd, static_cast<char>(va_arg(Args, int)));
break;
}
+ // In Scudo, `s64`/`u64` are supposed to use `lld` and `llu` respectively.
+ // However, `-Wformat` doesn't know we have a different parser for those
+ // placeholders and it keeps complaining the type mismatch on 64-bit
+ // platform which uses `ld`/`lu` for `s64`/`u64`. Therefore, in order to
+ // silence the warning, we turn to use `PRId64`/`PRIu64` for printing
+ // `s64`/`u64` and handle the `ld`/`lu` here.
+ case 'l': {
+ ++Cur;
+ RAW_CHECK(*Cur == 'd' || *Cur == 'u');
+
+ if (*Cur == 'd') {
+ DVal = va_arg(Args, s64);
+ Res +=
+ appendSignedDecimal(&Buffer, BufferEnd, DVal, Width, PadWithZero);
+ } else {
+ UVal = va_arg(Args, u64);
+ Res += appendUnsigned(&Buffer, BufferEnd, UVal, 10, Width, PadWithZero,
+ false);
+ }
+
+ break;
+ }
case '%': {
RAW_CHECK_MSG(!HaveFlags, PrintfFormatsHelp);
Res += appendChar(&Buffer, BufferEnd, '%');
#include "string_utils.h"
#include "thread_annotations.h"
+#include <inttypes.h>
#include <string.h>
namespace scudo {
Occurrence == 0 ? 0
: ((AccumulatedTime % Occurrence) * 10) / Occurrence;
- Str.append("%14lu.%lu(ns) %-11s", Integral, Fraction, " ");
+ Str.append("%14" PRId64 ".%" PRId64 "(ns) %-11s", Integral, Fraction, " ");
for (u32 I = 0; I < ExtraIndent; ++I)
Str.append("%s", " ");
- Str.append("%s (%lu)\n", Timers[HandleId].Name, Occurrence);
+ Str.append("%s (%" PRId64 ")\n", Timers[HandleId].Name, Occurrence);
for (u32 I = 0; I < NumAllocatedTimers; ++I)
if (Timers[I].Nesting == HandleId)