tsan: fix -Wgnu warnings
authorDmitry Vyukov <dvyukov@google.com>
Wed, 19 Dec 2012 06:59:45 +0000 (06:59 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 19 Dec 2012 06:59:45 +0000 (06:59 +0000)
llvm-svn: 170499

compiler-rt/lib/tsan/Makefile.old
compiler-rt/lib/tsan/rtl/Makefile.old
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc

index ff81fa9..034261a 100644 (file)
@@ -8,7 +8,7 @@ ifeq ($(DEBUG), 0)
        CXXFLAGS += -O3
 endif
 ifeq ($(CXX), clang++)
-  CXXFLAGS+= -Wno-unused-private-field -Wno-static-in-inline
+  CXXFLAGS+= -Wno-unused-private-field -Wno-static-in-inline -Wgnu
 endif
 
 LIBTSAN=rtl/libtsan.a
@@ -35,7 +35,7 @@ help:
        @ echo "  make install_deps  # Install third-party dependencies required for building"
        @ echo "  make presubmit     # Run it every time before committing"
        @ echo
-       @ echo "For more info, see http://code.google.com/p/data-race-test/wiki/ThreadSanitizer2"
+       @ echo "For more info, see http://code.google.com/p/thread-sanitizer/wiki/Development"
 
 $(LIBTSAN): libtsan
 
index 89ce832..51da5bb 100644 (file)
@@ -1,6 +1,9 @@
 CXXFLAGS = -fPIE -g -Wall -Werror -fno-builtin -DTSAN_DEBUG=$(DEBUG)
 ifeq ($(DEBUG), 0)
-       CXXFLAGS += -O3
+  CXXFLAGS += -O3
+endif
+ifeq ($(CXX), clang++)
+  CXXFLAGS+= -Wgnu
 endif
 
 # For interception. FIXME: move interception one level higher.
index da7356c..eb67c52 100644 (file)
@@ -1137,9 +1137,9 @@ TSAN_INTERCEPTOR(int, signalfd, int fd, void *mask, int flags) {
   return fd;
 }
 
-TSAN_INTERCEPTOR(int, inotify_init) {
-  SCOPED_TSAN_INTERCEPTOR(inotify_init);
-  int fd = REAL(inotify_init)();
+TSAN_INTERCEPTOR(int, inotify_init, int fake) {
+  SCOPED_TSAN_INTERCEPTOR(inotify_init, fake);
+  int fd = REAL(inotify_init)(fake);
   if (fd >= 0)
     FdInotifyCreate(thr, pc, fd);
   return fd;
@@ -1617,10 +1617,10 @@ TSAN_INTERCEPTOR(int, munlockall, void) {
   return 0;
 }
 
-TSAN_INTERCEPTOR(int, fork) {
-  SCOPED_TSAN_INTERCEPTOR(fork);
+TSAN_INTERCEPTOR(int, fork, int fake) {
+  SCOPED_TSAN_INTERCEPTOR(fork, fake);
   // It's intercepted merely to process pending signals.
-  int pid = REAL(fork)();
+  int pid = REAL(fork)(fake);
   if (pid == 0) {
     // child
     FdOnFork(thr, pc);