[12/40] sim/frv: Initialize nesr variable

Message ID 021dbd238af5dfe74523ed229d2156a155a6bb9e.1666257885.git.research_trasio@irq.a4lg.com
State Accepted
Headers
Series sim+gdb: Suppress warnings if built with Clang (big batch 1) |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Tsukasa OI Oct. 20, 2022, 9:25 a.m. UTC
  GCC generates a warning if a variable may be used uninitialized on some
cases ("-Wmaybe-uninitialized").  Despite that GCC will not cause a build
failure even when "--enable-werror" is specified, it would be nice to get
rid of it.

This commit initializes the variable nesr when declared.
---
 sim/frv/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/sim/frv/traps.c b/sim/frv/traps.c
index 0c9eacd0bfd..b142c7890ad 100644
--- a/sim/frv/traps.c
+++ b/sim/frv/traps.c
@@ -432,7 +432,7 @@  frvbf_check_non_excepting_load (
   int do_elos;
   SI NE_flags[2];
   SI NE_base;
-  SI nesr;
+  SI nesr = 0;
   SI ne_index;
   FRV_REGISTER_CONTROL *control;