From fa4ec13b44d1d6dc7bfe942e5904548456b49210 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Sat, 28 Feb 2026 15:51:38 +0100 Subject: [PATCH] build: Enable -Wcovered-switch-default The leveldb exclusion is required to avoid this warning in the subtree: ``` src/leveldb/util/status.cc:63:7: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default] 63 | default: | ^ 1 warning generated. ``` --- CMakeLists.txt | 1 + cmake/leveldb.cmake | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 518e02776d4..e7cb8965665 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,6 +449,7 @@ else() try_append_cxx_flags("-Wall" TARGET warn_interface SKIP_LINK) try_append_cxx_flags("-Wextra" TARGET warn_interface SKIP_LINK) try_append_cxx_flags("-Wgnu" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wcovered-switch-default" TARGET warn_interface SKIP_LINK) # Some compilers will ignore -Wformat-security without -Wformat, so just combine the two here. try_append_cxx_flags("-Wformat -Wformat-security" TARGET warn_interface SKIP_LINK) try_append_cxx_flags("-Wvla" TARGET warn_interface SKIP_LINK) diff --git a/cmake/leveldb.cmake b/cmake/leveldb.cmake index e21190420ec..cff8c61f96c 100644 --- a/cmake/leveldb.cmake +++ b/cmake/leveldb.cmake @@ -87,6 +87,9 @@ else() try_append_cxx_flags("-Wconditional-uninitialized" TARGET nowarn_leveldb_interface SKIP_LINK IF_CHECK_PASSED "-Wno-conditional-uninitialized" ) + try_append_cxx_flags("-Wcovered-switch-default" TARGET nowarn_leveldb_interface SKIP_LINK + IF_CHECK_PASSED "-Wno-covered-switch-default" + ) endif() target_link_libraries(leveldb PRIVATE