From 931ca9524ac2754464f2fa101732a02ee66d90f6 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 16 May 2024 14:53:31 +0800 Subject: [PATCH] warn_used_result and unused __attribute__ on IAR --- wolfssl/wolfcrypt/types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 1b43e7f4b1..ef036196a6 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -303,7 +303,8 @@ typedef struct w64wrapper { #ifndef WARN_UNUSED_RESULT #if defined(WOLFSSL_LINUXKM) && defined(__must_check) #define WARN_UNUSED_RESULT __must_check - #elif defined(__GNUC__) && (__GNUC__ >= 4) + #elif (defined(__GNUC__) && (__GNUC__ >= 4)) || \ + (defined(__IAR_SYSTEMS_ICC__) && (__VER__ >= 9040001)) #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else #define WARN_UNUSED_RESULT @@ -311,7 +312,7 @@ typedef struct w64wrapper { #endif /* WARN_UNUSED_RESULT */ #ifndef WC_MAYBE_UNUSED - #if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) + #if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) || defined(__IAR_SYSTEMS_ICC__) #define WC_MAYBE_UNUSED __attribute__((unused)) #else #define WC_MAYBE_UNUSED