From 5fd33d26f1a2dd6dfbb7e6c4659f5f4e7c5ba6d2 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 6 Nov 2014 12:01:02 -0800 Subject: [PATCH] Turn off -Wshadow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Makefile | 2 +- port/stack_trace.cc | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c2d206e91..d06d6f2a1 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 1aeb5f7b5..224cac700 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