From 712df559a2e8031c600ff07126de9bb08afbb0a2 Mon Sep 17 00:00:00 2001 From: JaagupA Date: Tue, 2 Sep 2025 15:31:10 +0300 Subject: [PATCH] Fix -Wshift-count-overflow warning for clang. llvm clang generates warning: warning: shift count >= width of type [-Wshift-count-overflow] when x==32, so a temporary upcast is required. --- nrfx/drivers/nrfx_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nrfx/drivers/nrfx_common.h b/nrfx/drivers/nrfx_common.h index 1064aff6..fe270718 100644 --- a/nrfx/drivers/nrfx_common.h +++ b/nrfx/drivers/nrfx_common.h @@ -168,7 +168,7 @@ extern "C" { * * @return Bit mask. */ -#define NRFX_BIT_MASK(x) (((x) == 32) ? UINT32_MAX : ((1UL << (x)) - 1)) +#define NRFX_BIT_MASK(x) (((x) == 32) ? UINT32_MAX : ((uint32_t)((1ULL << (x)) - 1))) /** * @brief Macro for returning size in bits for given size in bytes.