[compiler-rt] r305273 - tsan: fix pedantic warnings
Dmitry Vyukov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 13 00:09:56 PDT 2017
Author: dvyukov
Date: Tue Jun 13 02:09:56 2017
New Revision: 305273
URL: http://llvm.org/viewvc/llvm-project?rev=305273&view=rev
Log:
tsan: fix pedantic warnings
ISO C++ does not allow ?: with omitted middle operand
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc?rev=305273&r1=305272&r2=305273&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_report.cc Tue Jun 13 02:09:56 2017
@@ -92,7 +92,8 @@ static const char *ReportTypeString(Repo
if (typ == ReportTypeVptrUseAfterFree)
return "heap-use-after-free (virtual call vs free)";
if (typ == ReportTypeExternalRace) {
- return GetReportHeaderFromTag(tag) ?: "race on external object";
+ const char *str = GetReportHeaderFromTag(tag);
+ return str ? str : "race on external object";
}
if (typ == ReportTypeThreadLeak)
return "thread leak";
@@ -170,8 +171,9 @@ static void PrintMop(const ReportMop *mo
MopDesc(first, mop->write, mop->atomic), mop->size,
(void *)mop->addr, thread_name(thrbuf, mop->tid));
} else {
- const char *object_type =
- GetObjectTypeFromTag(mop->external_tag) ?: "external object";
+ const char *object_type = GetObjectTypeFromTag(mop->external_tag);
+ if (object_type == nullptr)
+ object_type = "external object";
Printf(" %s access of %s at %p by %s",
ExternalMopDesc(first, mop->write), object_type,
(void *)mop->addr, thread_name(thrbuf, mop->tid));
More information about the llvm-commits
mailing list