From: Kaige Li <likaige@loongson.cn>
To: David Hildenbrand <david@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: Kaige Li <likaige@loongson.cn>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH 2/2] target/arm: Fix compile error.
Date: Thu, 30 Jul 2020 09:56:22 +0800 [thread overview]
Message-ID: <1596074182-4920-2-git-send-email-likaige@loongson.cn> (raw)
In-Reply-To: <1596074182-4920-1-git-send-email-likaige@loongson.cn>
When I compile qemu with such as:
git clone https://git.qemu.org/git/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make
There is error log:
/home/LiKaige/qemu/target/arm/translate-a64.c: In function ‘disas_ldst’:
/home/LiKaige/qemu/target/arm/translate-a64.c:3392:5: error: ‘fn’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
fn(cpu_reg(s, rt), clean_addr, tcg_rs, get_mem_index(s),
^
/home/LiKaige/qemu/target/arm/translate-a64.c:3318:22: note: ‘fn’ was declared here
AtomicThreeOpFn *fn;
^
cc1: all warnings being treated as errors
So, add an initiallization value for fn to fix this.
Signed-off-by: Kaige Li <likaige@loongson.cn>
---
target/arm/translate-a64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 8c07649..910a91f 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3315,7 +3315,7 @@ static void disas_ldst_atomic(DisasContext *s, uint32_t insn,
bool r = extract32(insn, 22, 1);
bool a = extract32(insn, 23, 1);
TCGv_i64 tcg_rs, clean_addr;
- AtomicThreeOpFn *fn;
+ AtomicThreeOpFn *fn = tcg_gen_atomic_fetch_add_i64;
if (is_vector || !dc_isar_feature(aa64_atomics, s)) {
unallocated_encoding(s);
--
2.1.0
next prev parent reply other threads:[~2020-07-30 3:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-30 1:56 [PATCH 1/2] virtio-mem: Change PRIx32 to PRIXPTR to fix compile error Kaige Li
2020-07-30 1:56 ` Kaige Li [this message]
2020-07-30 8:44 ` [PATCH 2/2] target/arm: Fix " Peter Maydell
2020-07-30 11:18 ` Kaige Li
2020-07-30 11:21 ` Peter Maydell
2020-07-30 11:27 ` Kaige Li
2020-07-30 11:33 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1596074182-4920-2-git-send-email-likaige@loongson.cn \
--to=likaige@loongson.cn \
--cc=david@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).