]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Disable strict aliasing
authorMatthew Barr <matthew.barr@intel.com>
Wed, 22 Jun 2016 05:03:22 +0000 (15:03 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:59:40 +0000 (10:59 +1000)
Strict aliasing allows to compiler to make some optimisations, but they aren't
without risk. The benefits do not appear to be worth the risk.

CMakeLists.txt

index 2652cea3a35c3136d845dbbc71166b525b1474ce..1b6e0e94f534b9ef9d289b0c9131122bf57437f6 100644 (file)
@@ -173,8 +173,8 @@ else()
     endif()
 
     # set compiler flags - more are tested and added later
-    set(EXTRA_C_FLAGS "-std=c99 -Wall -Wextra -Wshadow -Wcast-qual")
-    set(EXTRA_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wno-shadow -Wswitch -Wreturn-type -Wcast-qual -Wno-deprecated -Wnon-virtual-dtor")
+    set(EXTRA_C_FLAGS "-std=c99 -Wall -Wextra -Wshadow -Wcast-qual -fno-strict-aliasing")
+    set(EXTRA_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wno-shadow -Wswitch -Wreturn-type -Wcast-qual -Wno-deprecated -Wnon-virtual-dtor -fno-strict-aliasing")
     if (NOT RELEASE_BUILD)
         # -Werror is most useful during development, don't potentially break
         # release builds