From 0ae378e92e4f631d169dd2cae75886e660a0b9c2 Mon Sep 17 00:00:00 2001 From: Jan Van Winkel Date: Fri, 23 Aug 2019 23:17:59 +0200 Subject: [PATCH] tests: kernel: Suppress warnings in intmath tests Suppress integer overflow warning generated by the check macros NEG_CHECK and ROLLOVER_CHECK in intmath tests Signed-off-by: Jan Van Winkel --- tests/kernel/common/src/intmath.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/kernel/common/src/intmath.c b/tests/kernel/common/src/intmath.c index b36f2722528..6e10f0d83bd 100644 --- a/tests/kernel/common/src/intmath.c +++ b/tests/kernel/common/src/intmath.c @@ -26,6 +26,11 @@ /* Checks that MAX+1==MIN in the given type */ #define ROLLOVER_CHECK(T, MAX, MIN) BUILD_ASSERT((T)((T)1 + (T)MAX) == (T)MIN) +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Winteger-overflow" +#endif + ROLLOVER_CHECK(unsigned int, 0xffffffff, 0); ROLLOVER_CHECK(unsigned short, 0xffff, 0); ROLLOVER_CHECK(unsigned char, 0xff, 0); @@ -50,6 +55,11 @@ NEG_CHECK(int, -1); NEG_CHECK(int, 0x80000000); NEG_CHECK(int, 0x7fffffff); ROLLOVER_CHECK(int, 2147483647, -2147483648); + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + /** * @addtogroup kernel_common_tests * @{