Skip to content

Commit

Permalink
WL#8896: Enable use of C++11 in MySQL server
Browse files Browse the repository at this point in the history
Follow-up patch:
Fix the last remaining deprecation warning because of std::auto_ptr.
Reenable deprecation warnings as errors since all now have been
fixed. Except for building Boost - completely silence those warnings.
  • Loading branch information
jhauglid committed Nov 26, 2015
1 parent 60765a9 commit dadf584
Showing 5 changed files with 25 additions and 5 deletions.
8 changes: 8 additions & 0 deletions client/dump/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -204,6 +204,14 @@ IF(HAVE_NO_LOGICAL_OP)
ADD_COMPILE_FLAGS(${MYSQLPUMP_BOOST_SOURCES} COMPILE_FLAGS "-Wno-logical-op")
ENDIF()

# Boost source use auto_ptr, deprecated in C++11
MY_CHECK_CXX_COMPILER_FLAG("-Wdeprecated-declarations"
HAVE_DEPRECATED_DECLARATIONS)
IF(HAVE_DEPRECATED_DECLARATIONS)
ADD_COMPILE_FLAGS(${MYSQLPUMP_BOOST_SOURCES}
COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF()

ADD_COMPILE_FLAGS(
compression_writer.cc
mysqldump_tool_chain_maker.cc
4 changes: 0 additions & 4 deletions cmake/maintainer.cmake
Original file line number Diff line number Diff line change
@@ -48,10 +48,6 @@ MY_ADD_C_WARNING_FLAG("Wundef")
MY_ADD_CXX_WARNING_FLAG("Wundef")

# Temporarily convert C++11 related errors to warnings
MY_CHECK_CXX_COMPILER_FLAG("-Wdeprecated-declarations" HAVE_DEPRECATED_DECLARATIONS)
IF(HAVE_DEPRECATED_DECLARATIONS)
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Wno-error=deprecated-declarations")
ENDIF()
MY_CHECK_CXX_COMPILER_FLAG("-Wdeprecated-register" HAVE_DEPRECATED_REGISTER)
IF(HAVE_DEPRECATED_REGISTER)
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Wno-error=deprecated-register")
8 changes: 8 additions & 0 deletions libmysqld/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -144,6 +144,14 @@ IF(HAVE_UNDEF)
COMPILE_FLAGS "-Wno-undef")
ENDIF()

# Boost source use auto_ptr, deprecated in C++11
MY_CHECK_CXX_COMPILER_FLAG("-Wdeprecated-declarations"
HAVE_DEPRECATED_DECLARATIONS)
IF(HAVE_DEPRECATED_DECLARATIONS)
ADD_COMPILE_FLAGS(${LIBMYSQLD_BOOST_SOURCES}
COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF()

# Handle out-of-source build from source package with possibly broken
# bison. Copy bison output to from source to build directory, if not already
# there
2 changes: 1 addition & 1 deletion plugin/rewriter/rewriter.cc
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ Rewriter::~Rewriter() { my_hash_free(&m_digests); }

bool Rewriter::load_rule(MYSQL_THD thd, Persisted_rule *diskrule)
{
std::auto_ptr<Rule> memrule_ptr(new Rule);
std::unique_ptr<Rule> memrule_ptr(new Rule);
Rule *memrule= memrule_ptr.get();
Rule::Load_status load_status= memrule->load(thd, diskrule);

8 changes: 8 additions & 0 deletions sql/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -416,6 +416,14 @@ IF(HAVE_UNDEF)
COMPILE_FLAGS "-Wno-undef")
ENDIF()

# Boost source use auto_ptr, deprecated in C++11
MY_CHECK_CXX_COMPILER_FLAG("-Wdeprecated-declarations"
HAVE_DEPRECATED_DECLARATIONS)
IF(HAVE_DEPRECATED_DECLARATIONS)
ADD_COMPILE_FLAGS(${SQL_BOOST_SOURCES}
COMPILE_FLAGS "-Wno-deprecated-declarations")
ENDIF()

MY_CHECK_CXX_COMPILER_FLAG("-fno-builtin-memcmp" HAVE_NO_BUILTIN_MEMCMP)
# See comments in filesort_compare-t.cc about __builtin_memcmp
IF(HAVE_NO_BUILTIN_MEMCMP)

0 comments on commit dadf584

Please sign in to comment.