[compiler-rt] r316558 - [tsan] Fix warnings in tsan_interceptors.cc from expansion of variadic macros

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 01:05:13 PDT 2017


Author: dvyukov
Date: Wed Oct 25 01:05:13 2017
New Revision: 316558

URL: http://llvm.org/viewvc/llvm-project?rev=316558&view=rev
Log:
[tsan] Fix warnings in tsan_interceptors.cc from expansion of variadic macros

C99 technically requires the rest arguments to be used in C variadic macros.
This presents a problem with the macro SCOPED_TSAN_INTERCEPTOR when func
takes no arguments. This happens with the function pause. Like other void
argument functions, we pass in a fake argument to avoid this warning.

Author: Alex Langford (xiaobai)
Reviewed in: https://reviews.llvm.org/D39151


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

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=316558&r1=316557&r2=316558&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Wed Oct 25 01:05:13 2017
@@ -371,9 +371,9 @@ TSAN_INTERCEPTOR(int, nanosleep, void *r
   return res;
 }
 
-TSAN_INTERCEPTOR(int, pause) {
-  SCOPED_TSAN_INTERCEPTOR(pause);
-  return BLOCK_REAL(pause)();
+TSAN_INTERCEPTOR(int, pause, int fake) {
+  SCOPED_TSAN_INTERCEPTOR(pause, fake);
+  return BLOCK_REAL(pause)(fake);
 }
 
 // The sole reason tsan wraps atexit callbacks is to establish synchronization




More information about the llvm-commits mailing list