]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Turn off -Wshadow
authorIgor Canadi <icanadi@fb.com>
Thu, 6 Nov 2014 20:01:02 +0000 (12:01 -0800)
committerIgor Canadi <icanadi@fb.com>
Thu, 6 Nov 2014 20:01:02 +0000 (12:01 -0800)
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
port/stack_trace.cc

index c2d206e910c11217e0df5d21644fcf83a59cc85c..d06d6f2a1cbd4fc0ed7d7e61662b9dd6b73ac3d3 100644 (file)
--- 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
 
index 1aeb5f7b5b4c47558321b61f68f9ca3f9d7c62e1..224cac700861a9d23bec967ddeceb1c9e6c1977f 100644 (file)
@@ -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 <unistd.h>
 #include <cxxabi.h>
 
+namespace rocksdb {
+namespace port {
+
 namespace {
 
 #ifdef OS_LINUX
@@ -126,7 +130,7 @@ void InstallStackTraceHandler() {
   signal(SIGABRT, StackTraceHandler);
 }
 
-#endif
-
 }  // namespace port
 }  // namespace rocksdb
+
+#endif