From 0461d95999923aa9d6470fc05e6cafd4bc4644f7 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 14 Apr 2026 20:25:58 +0900 Subject: [PATCH] Suppress -Warray-bounds for ymfm ymfm's fm_engine_base::output() contains OPL-specific rhythm code that accesses m_operator[13]/[17], which is out-of-bounds when instantiated for OPN (OPERATORS=12). The code is unreachable at runtime because rhythm_enable() returns false for OPN, but newer clang (emscripten) flag it statically. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3780594..afcd042 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ add_library(ymfm deps/ymfm/src/ymfm_adpcm.cpp deps/ymfm/src/ymfm_ssg.cpp) target_include_directories(ymfm PUBLIC deps/ymfm/src) +# Suppress false-positive -Warray-bounds in ymfm_fm.ipp. +if (NOT MSVC) + target_compile_options(ymfm PRIVATE -Wno-array-bounds) +endif() if (ANDROID)