Skip to content

Commit

Permalink
MdePkg: Update BASE_CR macro in Base.h for a Coverity error
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
philnoh2 committed Dec 20, 2024
1 parent 79a64e7 commit bdeeaa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MdePkg/Include/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bdeeaa5

Please sign in to comment.