From 926c2be9bae73c445a0c02d4bf5dd103b05de6ef Mon Sep 17 00:00:00 2001
From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Sat, 3 Apr 2010 08:20:08 +0000
Subject: [PATCH] turn off strict aliasing rules for gcc 4.4

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1914 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53cb659a5..48f8616d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,13 @@ endfunction()
 if (CMAKE_COMPILER_IS_GNUCXX)
   get_compiler_version(_GCC_VERSION)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+  if (_GCC_VERSION MATCHES "44")
+    # gcc 4.4. is very strict about aliasing rules. the shared_count
+    # implementation that is used boost's shared_ptr violates these rules. To
+    # silence the warnings and prevent miscompiles, enable
+    #  -fno-strict-aliasing
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
+  endif()
   if (APPLE AND NOT _GCC_VERSION MATCHES "42")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
   endif()
-- 
GitLab