From 7e03c40659fab2a96a8a4bb781101a945d3f857b Mon Sep 17 00:00:00 2001 From: Phil Noh Date: Fri, 20 Dec 2024 13:56:11 -0600 Subject: [PATCH] MdePkg: Update BASE_CR macro in Base.h for a Coverity error Coverity is a static analysis tool. It detects the macro as an error (case to incompatible type, cert_exp39_c_violation). The update resolves the error and supports compliance with the static analysis tool. Signed-off-by: Phil Noh --- MdePkg/Include/Base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 363e0fea40..554f827fd1 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -888,7 +888,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM @return A pointer to the structure from one of it's elements. **/ -#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field))) +#define BASE_CR(Record, TYPE, Field) ((TYPE *) (VOID *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field))) /** Checks whether a value is a power of two.