]> granicus.if.org Git - curl/commitdiff
krb5: fix compiler warning
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Wed, 12 Jun 2019 21:07:07 +0000 (23:07 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Thu, 13 Jun 2019 09:08:53 +0000 (11:08 +0200)
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

index e51dcd1c6803ae70f553a117b5697b2396c95e65..3c340eaf9a4e3aa64691515c85acf8f3fa53e869 100644 (file)
@@ -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);
     }
 }