<br><br><div class="gmail_quote">On Thu, Sep 13, 2012 at 3:54 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@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: samsonov<br>
Date: Thu Sep 13 06:54:41 2012<br>
New Revision: 163788<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=163788&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=163788&view=rev</a><br>
Log:<br>
[TSan] fix a bunch of warnings reported by pedantic gcc<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_report.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Sep 13 06:54:41 2012<br>
@@ -1366,11 +1366,11 @@<br>
}<br>
<br>
TSAN_INTERCEPTOR(sighandler_t, signal, int sig, sighandler_t h) {<br>
- sigaction_t act = {};<br>
+ sigaction_t act;<br>
act.sa_handler = h;<br>
REAL(memset)(&act.sa_mask, -1, sizeof(act.sa_mask));<br>
act.sa_flags = 0;<br>
- sigaction_t old = {};<br>
+ sigaction_t old;<br>
int res = sigaction(sig, &act, &old);<br>
if (res)<br>
return SIG_ERR;<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.h Thu Sep 13 06:54:41 2012<br>
@@ -28,7 +28,7 @@<br>
__tsan_memory_order_acquire = 1 << 2,<br>
__tsan_memory_order_release = 1 << 3,<br>
__tsan_memory_order_acq_rel = 1 << 4,<br>
- __tsan_memory_order_seq_cst = 1 << 5,<br>
+ __tsan_memory_order_seq_cst = 1 << 5<br>
} __tsan_memory_order;<br></blockquote><div><br></div><div><br></div><div>I don' like this warning. </div><div>Adding a comma after the last element of such a list is a very nice feature. </div><div>What do others think? </div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
__tsan_atomic8 __tsan_atomic8_load(const volatile __tsan_atomic8 *a,<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_mman.h Thu Sep 13 06:54:41 2012<br>
@@ -57,7 +57,7 @@<br>
MBlockSignal,<br>
<br>
// This must be the last.<br>
- MBlockTypeCount,<br>
+ MBlockTypeCount<br>
};<br>
<br>
// For internal data structures.<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc Thu Sep 13 06:54:41 2012<br>
@@ -48,7 +48,7 @@<br>
bool leaf[N] = {};<br>
for (int i = 1; i < N; i++) {<br>
for (int j = 0; j < N; j++) {<br>
- int z = CanLockTab[i][j];<br>
+ MutexType z = CanLockTab[i][j];<br>
if (z == MutexTypeInvalid)<br>
continue;<br>
if (z == MutexTypeLeaf) {<br>
@@ -56,8 +56,8 @@<br>
leaf[i] = true;<br>
continue;<br>
}<br>
- CHECK(!CanLockAdj[i][z]);<br>
- CanLockAdj[i][z] = true;<br>
+ CHECK(!CanLockAdj[i][(int)z]);<br>
+ CanLockAdj[i][(int)z] = true;<br>
cnt[i]++;<br>
}<br>
}<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.h Thu Sep 13 06:54:41 2012<br>
@@ -31,7 +31,7 @@<br>
MutexTypeAtExit,<br>
<br>
// This must be the last.<br>
- MutexTypeCount,<br>
+ MutexTypeCount<br>
};<br>
<br>
class Mutex {<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Thu Sep 13 06:54:41 2012<br>
@@ -178,8 +178,12 @@<br>
static int InitTlsSize() {<br>
typedef void (*get_tls_func)(size_t*, size_t*) INTERNAL_FUNCTION;<br>
get_tls_func get_tls = &_dl_get_tls_static_info;<br>
- if (get_tls == 0)<br>
- get_tls = (get_tls_func)dlsym(RTLD_NEXT, "_dl_get_tls_static_info");<br>
+ if (get_tls == 0) {<br>
+ void *get_tls_static_info_ptr = dlsym(RTLD_NEXT, "_dl_get_tls_static_info");<br>
+ CHECK_EQ(sizeof(get_tls), sizeof(get_tls_static_info_ptr));<br>
+ internal_memcpy(&get_tls, &get_tls_static_info_ptr,<br>
+ sizeof(get_tls_static_info_ptr));<br>
+ }<br>
CHECK_NE(get_tls, 0);<br>
size_t tls_size = 0;<br>
size_t tls_align = 0;<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_report.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_report.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_report.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_report.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_report.h Thu Sep 13 06:54:41 2012<br>
@@ -24,7 +24,7 @@<br>
ReportTypeThreadLeak,<br>
ReportTypeMutexDestroyLocked,<br>
ReportTypeSignalUnsafe,<br>
- ReportTypeErrnoInSignal,<br>
+ ReportTypeErrnoInSignal<br>
};<br>
<br>
struct ReportStack {<br>
@@ -51,7 +51,7 @@<br>
enum ReportLocationType {<br>
ReportLocationGlobal,<br>
ReportLocationHeap,<br>
- ReportLocationStack,<br>
+ ReportLocationStack<br>
};<br>
<br>
struct ReportLocation {<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h Thu Sep 13 06:54:41 2012<br>
@@ -316,7 +316,7 @@<br>
ThreadStatusCreated, // Created but not yet running.<br>
ThreadStatusRunning, // The thread is currently running.<br>
ThreadStatusFinished, // Joinable thread is finished but not yet joined.<br>
- ThreadStatusDead, // Joined, but some info (trace) is still alive.<br>
+ ThreadStatusDead // Joined, but some info (trace) is still alive.<br>
};<br>
<br>
// An info about a thread that is hold for some time after its termination.<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=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc?rev=163788&r1=163787&r2=163788&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 Thu Sep 13 06:54:41 2012<br>
@@ -301,7 +301,7 @@<br>
uptr addr_min, uptr addr_max) {<br>
Context *ctx = CTX();<br>
bool equal_stack = false;<br>
- RacyStacks hash = {};<br>
+ RacyStacks hash;<br>
if (flags()->suppress_equal_stacks) {<br>
hash.hash[0] = md5_hash(traces[0].Begin(), traces[0].Size() * sizeof(uptr));<br>
hash.hash[1] = md5_hash(traces[1].Begin(), traces[1].Size() * sizeof(uptr));<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h Thu Sep 13 06:54:41 2012<br>
@@ -250,7 +250,7 @@<br>
StatMtxAtExit,<br>
<br>
// This must be the last.<br>
- StatCnt,<br>
+ StatCnt<br>
};<br>
<br>
} // namespace __tsan<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_suppressions.h Thu Sep 13 06:54:41 2012<br>
@@ -26,7 +26,7 @@<br>
SuppressionRace,<br>
SuppressionMutex,<br>
SuppressionThread,<br>
- SuppressionSignal,<br>
+ SuppressionSignal<br>
};<br>
<br>
struct Suppression {<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h?rev=163788&r1=163787&r2=163788&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h?rev=163788&r1=163787&r2=163788&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_trace.h Thu Sep 13 06:54:41 2012<br>
@@ -35,7 +35,7 @@<br>
EventTypeLock,<br>
EventTypeUnlock,<br>
EventTypeRLock,<br>
- EventTypeRUnlock,<br>
+ EventTypeRUnlock<br>
};<br>
<br>
// Represents a thread event (from most significant bit):<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>