From 4a10a9c634de8ac8232dd6c9a78fc7f88199dce3 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:27:41 +1200 Subject: [PATCH 1/7] Add fallthroughs to GetMurmurHash3 --- Source/Core/Common/Hash.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index 3756bdcad4..f5b9da1b20 100644 --- a/Source/Core/Common/Hash.cpp +++ b/Source/Core/Common/Hash.cpp @@ -136,33 +136,46 @@ static u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) { case 15: k2 ^= u64(tail[14]) << 48; + [[fallthrough]]; case 14: k2 ^= u64(tail[13]) << 40; + [[fallthrough]]; case 13: k2 ^= u64(tail[12]) << 32; + [[fallthrough]]; case 12: k2 ^= u64(tail[11]) << 24; + [[fallthrough]]; case 11: k2 ^= u64(tail[10]) << 16; + [[fallthrough]]; case 10: k2 ^= u64(tail[9]) << 8; + [[fallthrough]]; case 9: k2 ^= u64(tail[8]) << 0; - + [[fallthrough]]; case 8: k1 ^= u64(tail[7]) << 56; + [[fallthrough]]; case 7: k1 ^= u64(tail[6]) << 48; + [[fallthrough]]; case 6: k1 ^= u64(tail[5]) << 40; + [[fallthrough]]; case 5: k1 ^= u64(tail[4]) << 32; + [[fallthrough]]; case 4: k1 ^= u64(tail[3]) << 24; + [[fallthrough]]; case 3: k1 ^= u64(tail[2]) << 16; + [[fallthrough]]; case 2: k1 ^= u64(tail[1]) << 8; + [[fallthrough]]; case 1: k1 ^= u64(tail[0]) << 0; bmix64(h1, h2, k1, k2, c1, c2); From 1c4208e1fbe8122919638c90b6fbc316da964206 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:28:33 +1200 Subject: [PATCH 2/7] Add fallthroughs to OpenGL InitExtentionList --- Source/Core/Common/GL/GLExtensions/GLExtensions.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp b/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp index 3a724f3aba..f1453bca22 100644 --- a/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp @@ -2157,8 +2157,10 @@ static void InitExtensionList(GLContext* context) default: case 320: s_extension_list["VERSION_GLES_3_2"] = true; + [[fallthrough]]; case 310: s_extension_list["VERSION_GLES_3_1"] = true; + [[fallthrough]]; case 300: s_extension_list["VERSION_GLES_3"] = true; break; @@ -2195,6 +2197,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl450exts) s_extension_list[it] = true; + [[fallthrough]]; } case 440: { @@ -2211,6 +2214,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl440exts) s_extension_list[it] = true; + [[fallthrough]]; } case 430: { @@ -2239,6 +2243,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl430exts) s_extension_list[it] = true; + [[fallthrough]]; } case 420: { @@ -2259,6 +2264,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl420exts) s_extension_list[it] = true; + [[fallthrough]]; } case 410: { @@ -2273,6 +2279,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl410exts) s_extension_list[it] = true; + [[fallthrough]]; } case 400: { @@ -2293,6 +2300,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl400exts) s_extension_list[it] = true; + [[fallthrough]]; } case 330: { @@ -2311,6 +2319,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl330exts) s_extension_list[it] = true; + [[fallthrough]]; } case 320: { @@ -2328,6 +2337,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl320exts) s_extension_list[it] = true; + [[fallthrough]]; } case 310: { @@ -2343,6 +2353,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl310exts) s_extension_list[it] = true; + [[fallthrough]]; } case 300: { @@ -2374,6 +2385,7 @@ static void InitExtensionList(GLContext* context) }; for (auto it : gl300exts) s_extension_list[it] = true; + [[fallthrough]]; } case 210: case 200: From ca33c38afd3a28566f5dade7e7fada444b0444c7 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:29:31 +1200 Subject: [PATCH 3/7] Add missing breaks (no behaviour change) --- Source/Core/Core/HW/MagCard/MagneticCardReader.cpp | 1 + Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Core/Core/HW/MagCard/MagneticCardReader.cpp b/Source/Core/Core/HW/MagCard/MagneticCardReader.cpp index 80013e3a29..db78b9ffdd 100644 --- a/Source/Core/Core/HW/MagCard/MagneticCardReader.cpp +++ b/Source/Core/Core/HW/MagCard/MagneticCardReader.cpp @@ -193,6 +193,7 @@ void MagneticCardReader::Command_33_ReadData() AppendRange(&m_command_payload, *track_data); } + break; } default: break; diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index a5f5ef6eea..67505f3ce4 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -356,6 +356,7 @@ void MemoryViewWidget::UpdateDispatcher(UpdateType type) // Values were captured on CPU thread while doing a callback. if (m_values.size() != 0) UpdateColumns(); + break; default: break; } From 7de31b291e71931b184d1517705cd70c3b8686f4 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 8 Aug 2026 13:14:29 +1200 Subject: [PATCH 4/7] Fix missing break in BluetoothRealDevice Minor behaviour change, prevents an erroreous error log --- Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp index 4a55024d6e..682d5553e7 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp @@ -146,6 +146,7 @@ std::optional BluetoothRealDevice::IOCtlV(const IOCtlVRequest& request } ERROR_LOG_FMT(IOS_WIIMOTE, "IOCTLV_USBV0_INTRMSG: Unknown endpoint: 0x{:02x}", cmd->endpoint); + break; } default: ERROR_LOG_FMT(IOS_WIIMOTE, "IOCtlV: Unknown request: 0x{:08x}", request.request); From a6cf98332b209a89273844d9dbaf0eda1f0d60a3 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:31:36 +1200 Subject: [PATCH 5/7] Fix fallthough in CodeView/MemoryView widgets This slightly changes the behaviour, but I think this is more correct. --- Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 2 ++ Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index c7a74ee29d..82d1473ee4 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -1174,7 +1174,9 @@ void CodeViewWidget::keyPressEvent(QKeyEvent* event) if (event->modifiers() == Qt::ControlModifier) { emit ActivateSearch(); + return; } + [[fallthrough]]; default: QWidget::keyPressEvent(event); break; diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index 67505f3ce4..09740fa6b5 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -126,7 +126,9 @@ public: if (event->modifiers() == Qt::ControlModifier) { m_view->TriggerActivateSearch(); + return; } + [[fallthrough]]; default: QWidget::keyPressEvent(event); return; From 02bffba368e99efbd18b35b1103523b1f26b1826 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:35:01 +1200 Subject: [PATCH 6/7] Enable implicit fallthrough warnings for gcc/clang --- Source/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7871083785..5a65524555 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -45,6 +45,7 @@ else() check_and_add_flag(INIT_SELF -Winit-self) check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations) check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations) + check_and_add_flag(IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough) # Disable -Wstringop-truncation warnings as they result in many false positives. # In most (all?) cases where std::strncpy is used, we want to fill the entire buffer From 94eceb35e8f263a167d9b2cce9ed901903c913ce Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 7 Aug 2026 19:43:15 +1200 Subject: [PATCH 7/7] Enable fallthrough warnings for msvc++ --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2622a18d7c..8f62d7f847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ set(AppleClang_min_version 14.0.3) set(MSVC_min_version 19.32) # Standard libraries set(libstdc++_min_version 12) # This should match GCC_min_version's major version. -set(libc++_min_version 150000) # This should match Clang_min_version in the format "xxyyzz" instead of "xx.yy.zz" +set(libc++_min_version 150000) # This should match Clang_min_version in the format "xxyyzz" instead of "xx.yy.zz" dolphin_check_toolset_version("Xcode" XCODE_VERSION ${Xcode_min_version}) dolphin_check_toolset_version("MSVC Toolset" MSVC_TOOLSET_VERSION ${MSVC_toolset_min_version}) @@ -273,6 +273,7 @@ if(MSVC) # Additional warnings add_compile_options( + /w15262 # Unannotated fallthrough between switch labels /w44263 # Non-virtual member function hides base class virtual function /w44265 # Class has virtual functions, but destructor is not virtual /w44946 # Reinterpret cast between related types