<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 24, 2014 at 12:19 AM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dvyukov<br>
Date: Mon Feb 24 02:19:53 2014<br>
New Revision: 202008<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=202008&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=202008&view=rev</a><br>
Log:<br>
tsan: fix compiler warning<br>
error: address of array 'tctx->name' will always evaluate to 'true'<br>
<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc?rev=202008&r1=202007&r2=202008&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc?rev=202008&r1=202007&r2=202008&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc Mon Feb 24 02:19:53 2014<br>
@@ -212,7 +212,7 @@ void ScopedReport::AddThread(const Threa<br>
rt->id = tctx->tid;<br>
rt->pid = tctx->os_id;<br>
rt->running = (tctx->status == ThreadStatusRunning);<br>
- rt->name = tctx->name ? internal_strdup(tctx->name) : 0;<br>
+ rt->name = internal_strdup(tctx->name);<br></blockquote><div><br></div><div>Why do you need to call strdup at all? This is char[] to char[] assignment... shouldn't that require a strcpy? (how does this code, or even the previous code, compile at all?)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
rt->parent_tid = tctx->parent_tid;<br>
rt->stack = 0;<br>
#ifdef TSAN_GO<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>