diff --git a/CMakeLists.txt b/CMakeLists.txt index eceb1c2..ea25230 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,12 +92,7 @@ if(NOT APPLE AND CMAKE_OBJCOPY) $) endif() -set(TEST_FLAGS -Wall -Wextra -Wunreachable-code -UNDEBUG) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - list(APPEND TEST_FLAGS -Wpedantic -Wno-gnu-anonymous-struct - -Wno-nested-anon-types) -endif() +set(TEST_FLAGS -Wall -Wextra -Wunreachable-code -Wpedantic -UNDEBUG) include(CTest) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 76e8ca6..e7eed08 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -181,6 +181,9 @@ struct Node { Type type; #ifndef NDEBUG + // Leaving this uninitialized is intentional and necessary to expect asserts + // to pass. Basically it needs to be preserved when going to the free list and + // back. int32_t partialKeyCapacity; #endif @@ -325,6 +328,8 @@ uint8_t *Node::partialKey() { case Type::Node256: return ((Node256 *)this)->partialKey(); } + __builtin_unreachable(); + ; // GCOVR_EXCL_LINE } struct NodeAllocators {