Fix issues related to Clang / LLVM 3.4
There were a few unused variables. The Clang GoldPlugin no longer supports
the -O4 flag; it is now equivalent to -O3 -flto, which is backwards
compatible.
Change-Id: I90a8cfe88d90871de6cf3a175b2ced2806e3fd8e
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6479982..4b2f4bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -513,16 +513,16 @@
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
ENDIF (CMAKE_COMPILER_IS_GNUCXX)
IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # Use of -O4 requires use of gold linker & LLVM-gold plugin, which might
+ # Use of -flto requires use of gold linker & LLVM-gold plugin, which might
# well not be present / in use and without which files will compile, but
# not link ('file not recognized') so explicitly check for support
INCLUDE(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-O4" HAVE_LTO_SUPPORT)
+ CHECK_CXX_COMPILER_FLAG("-flto" HAVE_LTO_SUPPORT)
IF (HAVE_LTO_SUPPORT)
- MESSAGE(STATUS "Enabling link-time optimization (-O4)")
- SET(CERES_CXX_FLAGS "${CERES_CXX_FLAGS} -O4")
+ MESSAGE(STATUS "Enabling link-time optimization (-flto)")
+ SET(CERES_CXX_FLAGS "${CERES_CXX_FLAGS} -flto")
ELSE ()
- MESSAGE(STATUS "Compiler/linker does not support link-time optimization (-O4), disabling.")
+ MESSAGE(STATUS "Compiler/linker does not support link-time optimization (-flto), disabling.")
ENDIF (HAVE_LTO_SUPPORT)
ENDIF ()
ENDIF (CMAKE_BUILD_TYPE STREQUAL "Release")
diff --git a/internal/ceres/gmock_gtest_all.cc b/internal/ceres/gmock_gtest_all.cc
index e2aabf2..cd56295 100644
--- a/internal/ceres/gmock_gtest_all.cc
+++ b/internal/ceres/gmock_gtest_all.cc
@@ -7918,7 +7918,6 @@
# endif // GTEST_OS_WINDOWS_MOBILE
#else
const char kPathSeparator = '/';
-const char kPathSeparatorString[] = "/";
const char kCurrentDirectoryString[] = "./";
#endif // GTEST_OS_WINDOWS
diff --git a/internal/ceres/line_search_minimizer.cc b/internal/ceres/line_search_minimizer.cc
index 6ed592c..3e8d18a 100644
--- a/internal/ceres/line_search_minimizer.cc
+++ b/internal/ceres/line_search_minimizer.cc
@@ -62,10 +62,6 @@
namespace ceres {
namespace internal {
namespace {
-// Small constant for various floating point issues.
-// TODO(sameeragarwal): Change to a better name if this has only one
-// use.
-const double kEpsilon = 1e-12;
// TODO(sameeragarwal): I think there is a small bug here, in that if
// the evaluation fails, then the state can contain garbage. Look at
diff --git a/internal/ceres/trust_region_minimizer.cc b/internal/ceres/trust_region_minimizer.cc
index 67f2b08..8f8ec98 100644
--- a/internal/ceres/trust_region_minimizer.cc
+++ b/internal/ceres/trust_region_minimizer.cc
@@ -56,8 +56,6 @@
namespace ceres {
namespace internal {
namespace {
-// Small constant for various floating point issues.
-const double kEpsilon = 1e-12;
LineSearch::Summary DoLineSearch(const Minimizer::Options& options,
const Vector& x,