[compiler-rt] r267679 - tsan: fix compiler warning

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 01:28:09 PDT 2016


Author: dvyukov
Date: Wed Apr 27 03:28:08 2016
New Revision: 267679

URL: http://llvm.org/viewvc/llvm-project?rev=267679&view=rev
Log:
tsan: fix compiler warning

tsan_debugging.cc: In function ‘void* __tsan_get_current_report()’:
tsan_debugging.cc:61:18: warning: cast from type ‘const __tsan::ReportDesc*’
                         to type ‘void*’ casts away qualifiers [-Wcast-qual]
   return (void *)rep;


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc?rev=267679&r1=267678&r2=267679&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc Wed Apr 27 03:28:08 2016
@@ -57,8 +57,7 @@ static void CopyTrace(SymbolizedStack *f
 // Meant to be called by the debugger.
 SANITIZER_INTERFACE_ATTRIBUTE
 void *__tsan_get_current_report() {
-  const ReportDesc *rep = cur_thread()->current_report;
-  return (void *)rep;
+  return const_cast<ReportDesc*>(cur_thread()->current_report);
 }
 
 SANITIZER_INTERFACE_ATTRIBUTE




More information about the llvm-commits mailing list