From 202408c6e7ea6a8eccc88c9e015a5ddfc77b18d0 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 26 Oct 2022 04:16:59 +0800 Subject: [PATCH] Fix gd32f4xx_syscfg.c:137:5: error: variable 'regaddr' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] Signed-off-by: Xiang Xiao --- arch/arm/src/gd32f4/gd32f4xx_syscfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/gd32f4/gd32f4xx_syscfg.c b/arch/arm/src/gd32f4/gd32f4xx_syscfg.c index 84f32ddf2f..145a4ff1ad 100644 --- a/arch/arm/src/gd32f4/gd32f4xx_syscfg.c +++ b/arch/arm/src/gd32f4/gd32f4xx_syscfg.c @@ -107,7 +107,7 @@ void gd32_syscfg_exmc_swap_config(uint32_t syscfg_exmc_swap) void gd32_syscfg_exti_line_config(uint8_t exti_port, uint8_t exti_pin) { uint32_t regval; - uint32_t regaddr; + uint32_t regaddr = 0; switch (exti_pin / SYSCFG_EXTI_SS_JSTEP) { @@ -135,6 +135,7 @@ void gd32_syscfg_exti_line_config(uint8_t exti_port, uint8_t exti_pin) regaddr = GD32_SYSCFG_EXTISS3; break; default: + DEBUGASSERT(false); break; }