From: Igor Canadi Date: Thu, 6 Nov 2014 20:01:02 +0000 (-0800) Subject: Turn off -Wshadow X-Git-Tag: rocksdb-3.7~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5fd33d26f1a2dd6dfbb7e6c4659f5f4e7c5ba6d2;p=rocksdb.git Turn off -Wshadow Summary: So glibc is not -Wshadow-safe, so we need to turn it off :( error: ‘int sigaction(int, const sigaction*, sigaction*)’ hides constructor for ‘struct sigaction’ The rest of the changes in this diff is that we include .h files under rocksdb namespace, which is a no-no. Test Plan: compiles now Reviewers: ljin, yhchiang, rven, sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D28413 --- diff --git a/Makefile b/Makefile index c2d206e9..d06d6f2a 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ install: @[ ! -e $(SHARED) ] || install -C -m 644 $(SHARED) $(INSTALL_PATH)/lib #------------------------------------------------- -WARNING_FLAGS = -Wall -Werror -Wsign-compare -Wshadow +WARNING_FLAGS = -Wall -Werror -Wsign-compare CFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual diff --git a/port/stack_trace.cc b/port/stack_trace.cc index 1aeb5f7b..224cac70 100644 --- a/port/stack_trace.cc +++ b/port/stack_trace.cc @@ -5,15 +5,16 @@ // #include "port/stack_trace.h" -namespace rocksdb { -namespace port { - #if defined(ROCKSDB_LITE) || !(defined(OS_LINUX) || defined(OS_MACOSX)) // noop +namespace rocksdb { +namespace port { void InstallStackTraceHandler() {} void PrintStack(int first_frames_to_skip) {} +} // namespace port +} // namespace rocksdb #else @@ -25,6 +26,9 @@ void PrintStack(int first_frames_to_skip) {} #include #include +namespace rocksdb { +namespace port { + namespace { #ifdef OS_LINUX @@ -126,7 +130,7 @@ void InstallStackTraceHandler() { signal(SIGABRT, StackTraceHandler); } -#endif - } // namespace port } // namespace rocksdb + +#endif