summaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-12-19 11:12:20 -0800
committerMark Rowe <mark@vector35.com>2025-12-20 21:34:49 -0800
commited0f3b1b8593f6b76fbb64c53a0885073c1c1979 (patch)
tree5d22d77ccea8bffc0619a32ed886d79d14daccf1 /view
parentba13f6ec7d0ce9a18a03a1c895fb72d18e03014a (diff)
Fix many of the warnings that show up when compiling with GCC 15.2
Diffstat (limited to 'view')
-rw-r--r--view/kernelcache/core/KernelCache.cpp2
-rw-r--r--view/kernelcache/core/KernelCacheView.cpp2
-rw-r--r--view/kernelcache/core/KernelCacheView.h2
-rw-r--r--view/kernelcache/core/MachO.cpp6
-rw-r--r--view/macho/machoview.cpp2
-rw-r--r--view/sharedcache/core/SharedCacheController.cpp3
-rw-r--r--view/sharedcache/core/SharedCacheController.h4
-rw-r--r--view/sharedcache/core/SharedCacheView.cpp2
-rw-r--r--view/sharedcache/core/SharedCacheView.h2
9 files changed, 10 insertions, 15 deletions
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<BinaryView> 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 <binaryninjaapi.h>
-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<CacheSymbol> KernelCacheMachOHeader::ReadSymbolTable(Ref<BinaryView>
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;
}
diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp
index 3c558963..2ff15f0e 100644
--- a/view/macho/machoview.cpp
+++ b/view/macho/machoview.cpp
@@ -3484,7 +3484,7 @@ void MachoView::ParseChainedStarts(MachOHeader& header, section_64 chainedStarts
}
else if (!bind)
{
- uint64_t entryOffset;
+ uint64_t entryOffset = 0;
switch (pointerFormat)
{
case DYLD_CHAINED_PTR_ARM64E:
diff --git a/view/sharedcache/core/SharedCacheController.cpp b/view/sharedcache/core/SharedCacheController.cpp
index ce3fde2c..d300017e 100644
--- a/view/sharedcache/core/SharedCacheController.cpp
+++ b/view/sharedcache/core/SharedCacheController.cpp
@@ -8,7 +8,8 @@ using namespace BinaryNinja::DSC;
// Unique ID for a given Binary View.
typedef uint64_t ViewId;
-std::shared_mutex GlobalControllersMutex;
+static std::shared_mutex GlobalControllersMutex;
+static const char* METADATA_KEY = "shared_cache";
std::map<ViewId, DSCRef<SharedCacheController>>& GlobalControllers()
{
diff --git a/view/sharedcache/core/SharedCacheController.h b/view/sharedcache/core/SharedCacheController.h
index cda3653c..cb381cbd 100644
--- a/view/sharedcache/core/SharedCacheController.h
+++ b/view/sharedcache/core/SharedCacheController.h
@@ -11,10 +11,6 @@ DECLARE_DSC_API_OBJECT(BNSharedCacheController, SharedCacheController);
void RegisterSharedCacheControllerDestructor();
namespace BinaryNinja::DSC {
- static const char* METADATA_KEY = "shared_cache";
- static const char* OLD_METADATA_KEY_COUNT = "SHAREDCACHE-ModifiedState-Count";
- static const char* OLD_METADATA_KEY_PREFIX = "SHAREDCACHE-ModifiedState-";
-
// Represents the view state for a given `DSCache`
class SharedCacheController : public DSCRefCountObject
{
diff --git a/view/sharedcache/core/SharedCacheView.cpp b/view/sharedcache/core/SharedCacheView.cpp
index a1428eab..dac39278 100644
--- a/view/sharedcache/core/SharedCacheView.cpp
+++ b/view/sharedcache/core/SharedCacheView.cpp
@@ -10,6 +10,8 @@
using namespace BinaryNinja;
using namespace BinaryNinja::DSC;
+static const char* VIEW_METADATA_KEY = "shared_cache_view";
+
SharedCacheViewType::SharedCacheViewType() : BinaryViewType(VIEW_NAME, VIEW_NAME) {}
// We register all our one-shot stuff here, such as the object destructor.
diff --git a/view/sharedcache/core/SharedCacheView.h b/view/sharedcache/core/SharedCacheView.h
index 9318c66c..5f916b30 100644
--- a/view/sharedcache/core/SharedCacheView.h
+++ b/view/sharedcache/core/SharedCacheView.h
@@ -7,8 +7,6 @@
#include <binaryninjaapi.h>
-static const char* VIEW_METADATA_KEY = "shared_cache_view";
-
class SharedCacheView : public BinaryNinja::BinaryView
{
bool m_parseOnly;