From 404993b29f1304fb53202fb88147298465bfb525 Mon Sep 17 00:00:00 2001 From: Tarek BOCHKATI Date: Mon, 11 Jan 2021 19:23:58 +0100 Subject: [PATCH] target/riscv: fix build error with -Werror=maybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit using gcc 9.3 on ubuntu focal fossa with -Werror=maybe-uninitialized we get this error: /src/target/riscv/riscv.c: In function ‘riscv_address_translate’: /src/target/riscv/riscv.c:1536:13: error: ‘pte’ may be used uninitialized Change-Id: I51e180b43f9b6996e4e4058db49c179b9f81bcdc Signed-off-by: Tarek BOCHKATI Reviewed-on: http://openocd.zylin.com/6013 Tested-by: jenkins Reviewed-by: Tim Newsome Reviewed-by: Tarek BOCHKATI Reviewed-by: Antonio Borneo --- src/target/riscv/riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 0d1cee1bfa..c26e6358fd 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1446,7 +1446,7 @@ static int riscv_address_translate(struct target *target, uint64_t ppn_value; target_addr_t table_address; virt2phys_info_t *info; - uint64_t pte; + uint64_t pte = 0; int i; if (riscv_rtos_enabled(target)) -- 2.30.2