From 5d21b8262b29165d1400ff31d6eeaf3bd5fe06ca Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sat, 6 Dec 2025 17:40:52 +0100 Subject: [PATCH] clang-tidy: enable bugprone-multi-level-implicit-pointer-conversion The default clang version in nixos 25.05 was llvm 19, we are now even past that Change-Id: Ieb62616fb87c4d2a8d892136a7164822aa1eceb6 --- .clang-tidy | 2 -- lix/libcmd/repl-interacter.cc | 2 +- lix/libexpr/eval.cc | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2d6a3d6fb..040170bae 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,8 +14,6 @@ Checks: - -bugprone-unchecked-optional-access # many warnings, seems like a questionable lint - -bugprone-branch-clone - # extremely noisy before clang 19: https://github.com/llvm/llvm-project/issues/93959 - - -bugprone-multi-level-implicit-pointer-conversion # we don't compile out our asserts - -bugprone-assert-side-effect # FIXME(jade): figure out if this warning is any good diff --git a/lix/libcmd/repl-interacter.cc b/lix/libcmd/repl-interacter.cc index caaf1682f..04f4fd886 100644 --- a/lix/libcmd/repl-interacter.cc +++ b/lix/libcmd/repl-interacter.cc @@ -48,7 +48,7 @@ char ** copyCompletions(const StringSet& possible) if (vp) { while (--ac >= 0) free(vp[ac]); - free(vp); + free(static_cast(vp)); } throw Error("allocation failure"); } diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index 3e6c003ed..c084c9add 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -291,14 +291,14 @@ EvalMemory::EvalMemory() { assert(libexprInitialised); #if HAVE_BOEHMGC - GC_add_roots(gcCache, gcCache + CACHES); + GC_add_roots(static_cast(gcCache), static_cast(gcCache + CACHES)); #endif } EvalMemory::~EvalMemory() { #if HAVE_BOEHMGC - GC_remove_roots(gcCache, gcCache + CACHES); + GC_remove_roots(static_cast(gcCache), static_cast(gcCache + CACHES)); #endif }