From f3bfeb18139d71365d83b6e779f892c29d85b131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 4 Jan 2014 01:46:22 +0100 Subject: [PATCH] Disable strict-aliasing warnings for GCC 4.5. The current warnings are harmless and just pollute the output, not present in GCC >= 4.6, thus I don't bother. --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 07e2de9c0..cc6a61656 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,6 +40,12 @@ endif() # etc. accessors (and I have no better solution for that yet) if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.0") OR CORRADE_GCC44_COMPATIBILITY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + +# For GCC 4.5 disable just the strict-aliasing warnings. They are mostly +# harmless and are just polluting the output. In case they aren't harmless +# anymore the strict-aliasing should be disabled here too. +elseif(CORRADE_GCC45_COMPATIBILITY AND NOT CORRADE_GCC44_COMPATIBILITY) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}")