From 92cb91664da0b3e32e5a5a84995f39aa126d1fff Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 7 Oct 2025 10:08:10 -0600 Subject: [PATCH] define WLOG to a no-op when not used with debugging --- src/internal.c | 1 + wolfssh/log.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 1fbae2598..fa80c2df6 100644 --- a/src/internal.c +++ b/src/internal.c @@ -11367,6 +11367,7 @@ int wolfSSH_RsaVerify(const byte *sig, word32 sigSz, #endif if (checkSig) WFREE(checkSig, heap, DYNTYPE_TEMP); + WOLFSSH_UNUSED(loc); /* Unused when WLOG is not defined */ return ret; } #endif /* WOLFSSH_NO_RSA */ diff --git a/wolfssh/log.h b/wolfssh/log.h index 26f202124..8758e7d43 100644 --- a/wolfssh/log.h +++ b/wolfssh/log.h @@ -72,11 +72,14 @@ WOLFSSH_API int wolfSSH_LogEnabled(void); WOLFSSH_API void wolfSSH_Log(enum wolfSSH_LogLevel, const char *const, ...) FMTCHECK; -#define WLOG(...) do { \ +#if defined(DEBUG_WOLFSSH) || defined(WOLFSSH_SSHD) + #define WLOG(...) do { \ if (wolfSSH_LogEnabled()) \ wolfSSH_Log(__VA_ARGS__); \ } while (0) - +#else + #define WLOG(...) WC_DO_NOTHING +#endif #ifdef __cplusplus }