You should be able to undefine MIN at the right place instead of turning off all warnings as errors.
Mike
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd Hoffmann
> Sent: Friday, December 3, 2021 8:08 AM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>;
> Pawel Polawski <ppolawsk@redhat.com>; Philippe Mathieu-Daudé <philmd@redhat.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>
> Subject: [edk2-devel] [PATCH 24/24] [hack] turn off -Werror
>
> workaround for this:
> CryptoPkg/Library/OpensslLib/openssl/providers/implementations/kdfs/kbkdf.c:49: warning: "MIN" redefined
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> index 7424cd16ac21..0ec925d8b53e 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> @@ -16,7 +16,7 @@ [Defines]
> VERSION_STRING = 1.0
> LIBRARY_CLASS = OpensslLib
> DEFINE OPENSSL_PATH = openssl
> - DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -
> D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_ASM
> + DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -
> D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_ASM -Wno-error
>
> #
> # VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
> --
> 2.33.1
>
>
>
>
>