tsan: fix -Wgnu warnings

llvm-svn: 170499
This commit is contained in:
Dmitry Vyukov 2012-12-19 06:59:45 +00:00
parent 2abbce6701
commit c467933dc7
3 changed files with 12 additions and 9 deletions

View 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

View 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.

View 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);