From fd67752a868361ff3308b8e5145d8b1f1f923f14 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 7 Nov 2018 22:47:02 +0300 Subject: [PATCH] Eliminate 'unreferenced formal parameter' compiler warning in msvc_dbg * extra/msvc_dbg.c (GetDescriptionFromAddress): Cast format argument to void. * extra/msvc_dbg.c (GetDescriptionFromStack): Pass format argument to GetDescriptionFromAddress (instead of NULL). --- extra/msvc_dbg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extra/msvc_dbg.c b/extra/msvc_dbg.c index feb58b31..60bbe5cb 100644 --- a/extra/msvc_dbg.c +++ b/extra/msvc_dbg.c @@ -312,6 +312,7 @@ size_t GetDescriptionFromAddress(void* address, const char* format, char*const end = buffer + size; size_t line_number = 0; + (void)format; if (size) { *buffer = 0; } @@ -356,11 +357,11 @@ size_t GetDescriptionFromStack(void* const frames[], size_t count, const GC_ULONG_PTR end = begin + size; GC_ULONG_PTR buffer = begin + (count + 1) * sizeof(char*); size_t i; - (void)format; + for (i = 0; i < count; ++i) { if (description) description[i] = (char*)buffer; - buffer += 1 + GetDescriptionFromAddress(frames[i], NULL, (char*)buffer, + buffer += 1 + GetDescriptionFromAddress(frames[i], format, (char*)buffer, end < buffer ? 0 : end - buffer); } if (description) -- 2.40.0