From 79bea2c64292f89e84709ecaeaa7716d8b3e9385 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Wed, 29 Nov 2023 18:43:58 +0100 Subject: [PATCH] Handle GCC warnings and linting --- math/wide_integer/uintwide_t.h | 9 ++++++++- test/test_uintwide_t_edge_cases.cpp | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/math/wide_integer/uintwide_t.h b/math/wide_integer/uintwide_t.h index 2a53adb..01a91e8 100644 --- a/math/wide_integer/uintwide_t.h +++ b/math/wide_integer/uintwide_t.h @@ -8,6 +8,10 @@ #ifndef UINTWIDE_T_2018_10_02_H // NOLINT(llvm-header-guard) #define UINTWIDE_T_2018_10_02_H + #if defined(__GNUC__) + #pragma GCC diagnostic ignored "-Wmissing-declarations" + #endif + #if ((__cplusplus < 202100L) || (defined(__GNUC__) && defined(__AVR__))) #include #else @@ -309,7 +313,6 @@ while(first != last) { using local_destination_value_type = typename iterator_detail::iterator_traits::value_type; - #if (defined(__GNUC__) && (__GNUC__ > 9)) #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif @@ -7920,4 +7923,8 @@ WIDE_INTEGER_NAMESPACE_END + #if defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif // UINTWIDE_T_2018_10_02_H diff --git a/test/test_uintwide_t_edge_cases.cpp b/test/test_uintwide_t_edge_cases.cpp index 702a5f6..81392a6 100644 --- a/test/test_uintwide_t_edge_cases.cpp +++ b/test/test_uintwide_t_edge_cases.cpp @@ -2455,12 +2455,12 @@ extern test_uintwide_t_edge::local_uintwide_t_small_signed_type local_one_minu auto test_uintwide_t_edge::one_as_small_unsigned_type() -> const test_uintwide_t_edge::local_uintwide_t_small_unsigned_type& { return local_one_plus_as_small_signed_type; } auto test_uintwide_t_edge::m_one_as_small_signed_type() -> const test_uintwide_t_edge::local_uintwide_t_small_signed_type& { return local_one_minus_as_small_signed_type; } -test_uintwide_t_edge::local_uintwide_t_small_unsigned_type local_one_plus_as_small_signed_type +test_uintwide_t_edge::local_uintwide_t_small_unsigned_type local_one_plus_as_small_signed_type // NOLINT(cert-err58-cpp) { static_cast>(UINT8_C(1)) }; -test_uintwide_t_edge::local_uintwide_t_small_signed_type local_one_minus_as_small_signed_type +test_uintwide_t_edge::local_uintwide_t_small_signed_type local_one_minus_as_small_signed_type // NOLINT(cert-err58-cpp) { static_cast>(INT8_C(-1)) };