summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-06-19 12:14:51 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-06-23 00:23:55 +0200
commit648e9696d38f9338019d30f297029ba34efb673c (patch)
tree02aafa8fdd4fe1b669c442f0951a187238990ff8
parente99e07cb5c939ca5bbb1dfdeb66c862d6cd4f2f2 (diff)
Disable -Werror=stringop-overflow on GCC >= 10
There's a number of upstream bugs that cause false positives; do not make them errors. Change-Id: I4151794d8d37177a47a34aef8d83accf4377d44a Pick-to: 6.1 6.2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--cmake/QtInternalTargets.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index 52d29a86731..1300453122e 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -32,6 +32,14 @@ function(qt_internal_set_warnings_are_errors_flags target)
list(APPEND flags -Wno-error=format-overflow)
endif()
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "10.0.0")
+ # GCC 10 has a number of bugs in -Wstringop-overflow. Do not make them an error.
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92955
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101134
+ list(APPEND flags -Wno-error=stringop-overflow)
+ endif()
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0")
# We do mixed enum arithmetic all over the place:
list(APPEND flags -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-enum-float-conversion)