From 4046eae72ad1a37aba6d1210519275d6d2a8c1df Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 6 Jun 2026 16:08:29 +0000 Subject: [PATCH] Tidy internal linkage and two stale/dead details Three small, behavior-preserving cleanups found during a structural review: - `clear_other_forwards()` is only used within `config.c`, but lacked a declaration and was an accidental exported symbol. Mark it `static` (confirmed no longer in the dynamic symbol table). - Fix a stale comment in `libblastrampoline_internal.h`: the surrogate functions live in `deepbindless.c`, not `deepbindless_surrogates.c`. - Simplify a dead condition in `autodetect_interface()`: the `ilaver != NULL` disjunct can never be true there (we return earlier when `ilaver` is found), so the check is just `dpotrf != NULL`. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/autodetection.c | 4 +++- src/config.c | 3 ++- src/libblastrampoline_internal.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/autodetection.c b/src/autodetection.c index e4e121f..0258388 100644 --- a/src/autodetection.c +++ b/src/autodetection.c @@ -249,7 +249,9 @@ int32_t autodetect_interface(void * handle, const char * suffix) { // those. build_symbol_name(symbol_name, "dpotrf_", suffix); void * dpotrf = lookup_symbol(handle, symbol_name); - if (ilaver != NULL || dpotrf != NULL) { + // NB: if `ilaver` were non-NULL we'd already have returned above, so it's + // guaranteed NULL here; only `dpotrf` matters. + if (dpotrf != NULL) { return autodetect_lapack_interface_dpotrf(dpotrf); } diff --git a/src/config.c b/src/config.c index b558fc2..25c1f12 100644 --- a/src/config.c +++ b/src/config.c @@ -64,7 +64,8 @@ void clear_forwarding_mark(int32_t symbol_idx, int32_t interface) { } } -void clear_other_forwards(int skip_idx, uint8_t * forwards, int32_t interface) { +// Only used within this file; keep it out of the library's exported symbols. +static void clear_other_forwards(int skip_idx, uint8_t * forwards, int32_t interface) { for (int idx=0; idx