From effbb4de819109c4ed19f3e384cb68e3db7d23f3 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 21 Dec 2017 17:38:13 +0100 Subject: [PATCH] [build] fix IAR and Keil build warnings (#2436) * Apply fixes for IAR Signed-off-by: Robert Lubos * Apply fixes for Keil Signed-off-by: Robert Lubos --- examples/platforms/nrf52840/openthread-core-nrf52840-config.h | 1 + include/openthread/platform/toolchain.h | 4 +++- src/core/common/instance.cpp | 2 +- src/core/mac/mac.cpp | 2 +- src/core/thread/thread_tlvs.hpp | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h index 7f7afb43a..e9dadfc70 100644 --- a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h +++ b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h @@ -162,6 +162,7 @@ */ #if defined(__CC_ARM) _Pragma("diag_suppress=111") + _Pragma("diag_suppress=128") #endif #endif // OPENTHREAD_CORE_NRF52840_CONFIG_H_ diff --git a/include/openthread/platform/toolchain.h b/include/openthread/platform/toolchain.h index c3971ce94..4283d066d 100644 --- a/include/openthread/platform/toolchain.h +++ b/include/openthread/platform/toolchain.h @@ -243,8 +243,10 @@ extern "C" { #define OT_UNREACHABLE_CODE(CODE) \ _Pragma("diag_suppress=Pe111") \ + _Pragma("diag_suppress=Pe128") \ CODE \ - _Pragma("diag_default=Pe111") + _Pragma("diag_default=Pe111") \ + _Pragma("diag_default=Pe128") #elif defined(__CC_ARM) diff --git a/src/core/common/instance.cpp b/src/core/common/instance.cpp index a8685d37d..61447c827 100644 --- a/src/core/common/instance.cpp +++ b/src/core/common/instance.cpp @@ -392,4 +392,4 @@ template<> Utils::SupervisionListener &Instance::Get(void) return GetThreadNetif().GetSupervisionListener(); } -} // namespance ot \ No newline at end of file +} // namespace ot diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 2e24107f0..7f0c2190e 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -1042,7 +1042,7 @@ void Mac::HandleTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame, otEr default: assert(false); - ExitNow(); + OT_UNREACHABLE_CODE(ExitNow()); } // Determine whether a CSMA retry is required. diff --git a/src/core/thread/thread_tlvs.hpp b/src/core/thread/thread_tlvs.hpp index 9adcebe07..7b9165e5f 100644 --- a/src/core/thread/thread_tlvs.hpp +++ b/src/core/thread/thread_tlvs.hpp @@ -161,7 +161,7 @@ private: * This class implements Extended MAC Address TLV generation and parsing. * */ -OT_TOOL_PACKED_BEGIN; +OT_TOOL_PACKED_BEGIN class ThreadExtMacAddressTlv: public ThreadTlv { public: