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 <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-10-26 04:16:59 +08:00 committed by Petro Karashchenko
parent 513904d1df
commit 202408c6e7
1 changed files with 2 additions and 1 deletions

View File

@ -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) void gd32_syscfg_exti_line_config(uint8_t exti_port, uint8_t exti_pin)
{ {
uint32_t regval; uint32_t regval;
uint32_t regaddr; uint32_t regaddr = 0;
switch (exti_pin / SYSCFG_EXTI_SS_JSTEP) 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; regaddr = GD32_SYSCFG_EXTISS3;
break; break;
default: default:
DEBUGASSERT(false);
break; break;
} }