From 06bfe5b9863ba805712a1b4045bd685f7570c19f Mon Sep 17 00:00:00 2001 From: Ivan Kush Date: Tue, 1 Jul 2025 10:13:03 +0300 Subject: [PATCH] Fix warning shadowing result variable in the #define CHECK_ENUM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` In file included from src/libkmip/libkmip/src/kmip.c:15: src/libkmip/libkmip/src/kmip.c: In function ‘kmip_decode_name’: ../../contrib/pg_tde/src/libkmip/libkmip/include/kmip.h:1414:9: warning: declaration of ‘result’ shadows a previous local [-Wshadow=compatible-local] int result = kmip_check_enum_value((A)->version, (B), (C)); \ ^~~~~~ src/libkmip/libkmip/src/kmip.c:12759:5: note: in expansion of macro ‘CHECK_ENUM’ CHECK_ENUM(ctx, KMIP_TAG_NAME_TYPE, value->type); ^~~~~~~~~~ src/libkmip/libkmip/src/kmip.c:12742:9: note: shadowed declaration is here int result = 0; ^~~~~~ ``` --- libkmip/include/kmip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libkmip/include/kmip.h b/libkmip/include/kmip.h index a39c293..e2aff75 100644 --- a/libkmip/include/kmip.h +++ b/libkmip/include/kmip.h @@ -1491,12 +1491,12 @@ typedef int64 intptr; #define CHECK_ENUM(A, B, C) \ do \ { \ - int result = kmip_check_enum_value ((A)->version, (B), (C)); \ - if (result != KMIP_OK) \ + int __result = kmip_check_enum_value ((A)->version, (B), (C)); \ + if (__result != KMIP_OK) \ { \ - kmip_set_enum_error_message ((A), (B), (C), result); \ + kmip_set_enum_error_message ((A), (B), (C), __result); \ kmip_push_error_frame ((A), __func__, __LINE__); \ - return (result); \ + return (__result); \ } \ } \ while (0)