diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cpp b/compiler-rt/lib/ubsan/ubsan_diag.cpp --- a/compiler-rt/lib/ubsan/ubsan_diag.cpp +++ b/compiler-rt/lib/ubsan/ubsan_diag.cpp @@ -157,7 +157,7 @@ return; } case Location::LK_Memory: - Buffer->append("%p", Loc.getMemoryLocation()); + Buffer->append("%p", reinterpret_cast(Loc.getMemoryLocation())); return; case Location::LK_Symbolized: { const AddressInfo &Info = Loc.getSymbolizedStack()->info; @@ -169,7 +169,7 @@ RenderModuleLocation(Buffer, Info.module, Info.module_offset, Info.module_arch, common_flags()->strip_path_prefix); else - Buffer->append("%p", Info.address); + Buffer->append("%p", reinterpret_cast(Info.address)); return; } case Location::LK_Null: @@ -286,7 +286,7 @@ Buffer.append("\n"); // Emit highlights. - Buffer.append(Decor.Highlight()); + Buffer.append("%s", Decor.Highlight()); Range *InRange = upperBound(Min, Ranges, NumRanges); for (uptr P = Min; P != Max; ++P) { char Pad = ' ', Byte = ' '; @@ -355,7 +355,7 @@ Buffer.clear(); } - Buffer.append(Decor.Bold()); + Buffer.append("%s", Decor.Bold()); RenderLocation(&Buffer, Loc); Buffer.append(":");