aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-04-19 20:50:34 +0100
committerAnders Broman <a.broman58@gmail.com>2019-04-20 06:06:24 +0000
commit8fd2e102a5c15044384943ae18efa7971aa92c37 (patch)
tree0e0b7e58f5a3a451a058f280f5458aae4c5dfb1e /CMakeLists.txt
parent6866896ed1a4ca7bc4615fedf5ab75e28a1d567a (diff)
CMake: silence -Wunsafe-loop-optimizations for GCC 7
Clang does not implement this option, so do not bother checking it there. GCC 6 is fine, GCC 7 is broken and GCC 8 is fixed again. Change-Id: I3bc9ff4e934e05b1b3ce7d4c4a41bf40d6e38655 Reviewed-on: https://code.wireshark.org/review/32904 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d182d43017..a58d757a62 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -658,11 +658,6 @@ else() # ! MSVC
#
-Wredundant-decls
#
- # Some loops are safe, but it's hard to convince the
- # compiler of that.
- #
- -Wunsafe-loop-optimizations
- #
# All the registration functions block these for now.
#
-Wmissing-prototypes
@@ -696,6 +691,16 @@ else() # ! MSVC
-fno-delete-null-pointer-checks
)
+ #
+ # Some loops are safe, but it's hard to convince the compiler of
+ # that. Always disable the warning on GCC 7 due to a bug that
+ # cause lots of false positives.
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81408
+ #
+ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION MATCHES "^7\\.")
+ list(APPEND WIRESHARK_COMMON_FLAGS -Wunsafe-loop-optimizations)
+ endif()
+
list(APPEND WIRESHARK_C_ONLY_FLAGS
# The following are C only, not C++
#