diff options
author | MikeGitb <MikeGitb@users.noreply.github.com> | 2016-10-17 20:36:11 +0100 |
---|---|---|
committer | Neil MacIntosh <neilmac@microsoft.com> | 2016-10-17 12:36:11 -0700 |
commit | 1287e624cd3e23c7a3edc036de59690d733815d3 (patch) | |
tree | 1e6d78fa446d087ae001ac5348806e8565f2c395 /tests/CMakeLists.txt | |
parent | 9ef335ce32a2287a810fc51dd2f9abd63e852ddf (diff) | |
download | platform_external_Microsoft-GSL-1287e624cd3e23c7a3edc036de59690d733815d3.tar.gz platform_external_Microsoft-GSL-1287e624cd3e23c7a3edc036de59690d733815d3.tar.bz2 platform_external_Microsoft-GSL-1287e624cd3e23c7a3edc036de59690d733815d3.zip |
Address #313: try to guard against strict-aliasing bugs with gsl::byte
* Add test to demonstrate byte aliasing problem on g++ and clang++
* Add note about no-strict-aliasing flag in README
* Activate aliasing unit test and use -fno-strict-aliasing flag
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3c3125e..e480474 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,9 +24,9 @@ else() CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX14) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-missing-braces") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -std=c++14 -O3 -Wall -Wno-missing-braces") elseif(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-missing-braces") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -std=c++11 -O3 -Wall -Wno-missing-braces") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() |