From: Matthew Barr Date: Wed, 22 Jun 2016 05:03:22 +0000 (+1000) Subject: Disable strict aliasing X-Git-Tag: v4.3.0^2~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ded5936173fb97fb0d5e5943d87fb91a114b51;p=thirdparty%2Fvectorscan.git Disable strict aliasing 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. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2652cea3..1b6e0e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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