From 74f911d4635a2f120e9afee2810fa62a41f18bce Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Wed, 12 Jun 2019 23:07:07 +0200 Subject: krb5: fix compiler warning Even though the variable was used in a DEBUGASSERT, GCC 8 warned in debug mode: krb5.c:324:17: error: unused variable 'maj' [-Werror=unused-variable] Just suppress the warning and declare the variable unconditionally instead of only for DEBUGBUILD (which also missed the check for HAVE_ASSERT_H). Closes https://github.com/curl/curl/pull/4020 --- lib/krb5.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/krb5.c') diff --git a/lib/krb5.c b/lib/krb5.c index e51dcd1c6..3c340eaf9 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -320,10 +320,8 @@ static void krb5_end(void *app_data) OM_uint32 min; gss_ctx_id_t *context = app_data; if(*context != GSS_C_NO_CONTEXT) { -#ifdef DEBUGBUILD - OM_uint32 maj = -#endif - gss_delete_sec_context(&min, context, GSS_C_NO_BUFFER); + OM_uint32 maj = gss_delete_sec_context(&min, context, GSS_C_NO_BUFFER); + (void)maj; DEBUGASSERT(maj == GSS_S_COMPLETE); } } -- cgit v1.2.3