From 945db1173da20c979d1a11d76b69bd2f00d51d97 Mon Sep 17 00:00:00 2001 From: seanc Date: Mon, 14 Oct 2013 07:59:22 -0700 Subject: [PATCH] Fix GCC 4.8 warning spew Summary: Suppress unused local typedef warning in GCC 4.8 because it is currently triggered by multiple Boost (at least as of 1.53) headers. Reviewed By: @sgolemon --- CMake/HPHPCompiler.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMake/HPHPCompiler.cmake b/CMake/HPHPCompiler.cmake index 720b28b6bae..31031d299cc 100644 --- a/CMake/HPHPCompiler.cmake +++ b/CMake/HPHPCompiler.cmake @@ -16,6 +16,12 @@ int main() { return 0; }" HAVE_GCC_46) #endif int main() { return 0; }" HAVE_GCC_47) + CHECK_C_SOURCE_COMPILES("#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#if GCC_VERSION < 40800 +#error Not GCC 4.8.0+ +#endif +int main() { return 0; }" HAVE_GCC_48) + endif() set(FREEBSD FALSE) @@ -37,8 +43,12 @@ else() if(HAVE_GCC_47) set(GNUCC_UNINIT_OPT "-Wno-maybe-uninitialized") endif() + set(GNUCC_LOCAL_TYPEDEF_OPT "") + if(HAVE_GCC_48) + set(GNUCC_LOCAL_TYPEDEF_OPT "-Wno-unused-local-typedefs") + endif() set(CMAKE_C_FLAGS "-w") - set(CMAKE_CXX_FLAGS "-fno-gcse -fno-omit-frame-pointer -ftemplate-depth-180 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-strict-aliasing -Wno-write-strings -Wno-invalid-offsetof -fno-operator-names -Wno-error=array-bounds -Wno-error=switch -std=gnu++0x -Werror=format-security -Wno-unused-result -Wno-sign-compare -Wno-attributes ${GNUCC_UNINIT_OPT}") + set(CMAKE_CXX_FLAGS "-fno-gcse -fno-omit-frame-pointer -ftemplate-depth-180 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-strict-aliasing -Wno-write-strings -Wno-invalid-offsetof -fno-operator-names -Wno-error=array-bounds -Wno-error=switch -std=gnu++0x -Werror=format-security -Wno-unused-result -Wno-sign-compare -Wno-attributes ${GNUCC_UNINIT_OPT} ${GNUCC_LOCAL_TYPEDEF_OPT}") endif() if(CMAKE_COMPILER_IS_GNUCC) -- 2.11.4.GIT