From ed0f3b1b8593f6b76fbb64c53a0885073c1c1979 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Fri, 19 Dec 2025 11:12:20 -0800 Subject: Fix many of the warnings that show up when compiling with GCC 15.2 --- view/kernelcache/core/KernelCache.cpp | 2 +- view/kernelcache/core/KernelCacheView.cpp | 2 +- view/kernelcache/core/KernelCacheView.h | 2 -- view/kernelcache/core/MachO.cpp | 6 +++--- 4 files changed, 5 insertions(+), 7 deletions(-) (limited to 'view/kernelcache') diff --git a/view/kernelcache/core/KernelCache.cpp b/view/kernelcache/core/KernelCache.cpp index ef5fd8a5..6ff88ad1 100644 --- a/view/kernelcache/core/KernelCache.cpp +++ b/view/kernelcache/core/KernelCache.cpp @@ -305,7 +305,7 @@ void KernelCache::ProcessRelocations(Ref view, linkedit_data_command if (!bind) { - uint64_t entryOffset; + uint64_t entryOffset = 0; switch (starts.pointer_format) { case DYLD_CHAINED_PTR_ARM64E: diff --git a/view/kernelcache/core/KernelCacheView.cpp b/view/kernelcache/core/KernelCacheView.cpp index 8e942268..82f3ce7f 100644 --- a/view/kernelcache/core/KernelCacheView.cpp +++ b/view/kernelcache/core/KernelCacheView.cpp @@ -9,7 +9,7 @@ using namespace BinaryNinja; using namespace BinaryNinja::KC; -[[maybe_unused]] KernelCacheViewType* g_kcViewType; +static KernelCacheViewType* g_kcViewType; KernelCacheViewType::KernelCacheViewType() : BinaryViewType(KC_VIEW_NAME, KC_VIEW_NAME) {} diff --git a/view/kernelcache/core/KernelCacheView.h b/view/kernelcache/core/KernelCacheView.h index 9a2baf6f..bfe12502 100644 --- a/view/kernelcache/core/KernelCacheView.h +++ b/view/kernelcache/core/KernelCacheView.h @@ -7,8 +7,6 @@ #include -static const char* VIEW_METADATA_KEY = "shared_cache_view"; - class KernelCacheView : public BinaryNinja::BinaryView { bool m_parseOnly; diff --git a/view/kernelcache/core/MachO.cpp b/view/kernelcache/core/MachO.cpp index 9eabf086..01b5da74 100644 --- a/view/kernelcache/core/MachO.cpp +++ b/view/kernelcache/core/MachO.cpp @@ -483,9 +483,9 @@ std::vector KernelCacheMachOHeader::ReadSymbolTable(Ref if (nlist.n_strx >= stringInfo.entries) { // TODO: where logger? - LogError( - "Symbol entry at index %llu has a string offset of %u which is outside the strings buffer of size %llu " - "for symbol table %x", + LogErrorF( + "Symbol entry at index {} has a string offset of {} which is outside the strings buffer of size {} " + "for symbol table {:#x}", entryIndex, nlist.n_strx, stringInfo.address, stringInfo.entries); continue; } -- cgit v1.3.1