From e5051bac9ec32fbdef24d06cfd97e91d00864636 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 8 Mar 2024 14:56:16 -0800 Subject: [PATCH] Clean up some vestiges of fixed-size partial keys --- CMakeLists.txt | 7 +------ ConflictSet.cpp | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) 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 {