aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorrolandschulz <roland@rschulz.eu>2017-03-27 17:30:54 -0700
committerEric <eric@efcs.ca>2017-03-27 18:30:54 -0600
commit9b92ed76a8620354403b5f1d089560048b6843bb (patch)
tree9e31d064e7fbd0057324c7fa8cf511d8d2bf82b0 /CMakeLists.txt
parentf5ff6d0e0d3d00cf07bb8306548b637e98b13720 (diff)
downloadgoogle-benchmark-9b92ed76a8620354403b5f1d089560048b6843bb.tar.gz
Fix ICC compiler warnings (#358)
fixes #354 The build fails with ICC17 because of warnings and Werror. What is the correct solution to fix it? Should a patch disable Werror for ICC (or maybe all non known compilers) disable the false postive warnings for all files. This could be done using: add_cxx_compiler_flag(-wd2102) #ICC17u2: Many false positives for Wstrict-aliasing add_cxx_compiler_flag(-wd2259) #ICC17u2: non-pointer conversion from "long" to "int" may lose significant bits (even for explicit static cast, sleep.cc(44)) add_cxx_compiler_flag(-wd654) #ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden (because of deprecated overload) disable warnings at file level or some other granularity
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3abf0f..713d22b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,8 +92,13 @@ else()
add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
endif()
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
- add_cxx_compiler_flag(-Wstrict-aliasing)
+ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
+ add_cxx_compiler_flag(-Wstrict-aliasing)
+ endif()
endif()
+ # ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
+ # (because of deprecated overload)
+ add_cxx_compiler_flag(-wd654)
add_cxx_compiler_flag(-Wthread-safety)
if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)