diff options
author | Tarek BOCHKATI <tarek.bouchkati@st.com> | 2021-01-11 19:23:58 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-01-18 15:31:56 +0000 |
commit | 404993b29f1304fb53202fb88147298465bfb525 (patch) | |
tree | 0602830e2cd3705ad39d764b62e5e653178bf13f /src/target | |
parent | 310c9800c72f37dd50e855513badc908fcfbafcf (diff) | |
download | riscv-openocd-404993b29f1304fb53202fb88147298465bfb525.zip riscv-openocd-404993b29f1304fb53202fb88147298465bfb525.tar.gz riscv-openocd-404993b29f1304fb53202fb88147298465bfb525.tar.bz2 |
target/riscv: fix build error with -Werror=maybe-uninitialized
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 <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6013
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/riscv/riscv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 0d1cee1..c26e635 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)) |