aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorcomex <[email protected]>2023-08-20 14:30:09 -0700
committermerry <[email protected]>2024-01-02 18:59:54 +0000
commit563b40587aebf39f77111ec651fbd6125ef66c0e (patch)
tree46952efef83317e777288c396f6aa0e201a8f283 /CMakeLists.txt
parentb372dc61573968515df527b78f6aaf44997c513f (diff)
downloaddynarmic-563b40587aebf39f77111ec651fbd6125ef66c0e.tar.gz
dynarmic-563b40587aebf39f77111ec651fbd6125ef66c0e.zip
CMakeLists: disable -Warray-bounds for GCC
The reason why is explained in the comment.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bfc9508..6e27ad20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,15 @@ else()
-Wfatal-errors)
endif()
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ # GCC produces bogus -Warray-bounds warnings from xbyak headers for code paths that are not
+ # actually reachable. Specifically, it happens in cases where some code casts an Operand&
+ # to Address& after first checking isMEM(), and that code is inlined in a situation where
+ # GCC knows that the variable is actually a Reg64. isMEM() will never return true for a
+ # Reg64, but GCC doesn't know that.
+ list(APPEND DYNARMIC_CXX_FLAGS -Wno-array-bounds)
+ endif()
+
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
# Bracket depth determines maximum size of a fold expression in Clang since 9c9974c3ccb6.
# And this in turns limits the size of a std::array.