Add -Wno-error=stringop-overread to warnings_are_errors_flags

Besides `stringop-overflow`, the `stringop-overread` is also buggy, and
it has some false positives. If not silenced, this will break the
unity build as several warnings are being emitted in qmetaobject.cpp,
etc.

Pick-to: 6.5
Change-Id: I708c81057c01d8d8fc9694c394c89602a2f6867b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Amir Masoud Abdol 2023-04-06 17:37:00 +02:00
parent 3983babd71
commit f5aa8317d0

View File

@ -48,6 +48,11 @@ function(qt_internal_set_warnings_are_errors_flags target target_scope)
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)
# GCC has some false positive, and it specifically comes through in MINGW
if (MINGW)
list(APPEND flags -Wno-error=stringop-overread)
endif()
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.2.0")