QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3] target/arm: Fix compile error in gcc 4.9.4.
@ 2020-07-31  9:07 Kaige Li
  2020-07-31  9:20 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Kaige Li @ 2020-07-31  9:07 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel

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

Add an initiallization value NULL 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..c98dfb1 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 = NULL;
 
     if (is_vector || !dc_isar_feature(aa64_atomics, s)) {
         unallocated_encoding(s);
-- 
2.1.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] target/arm: Fix compile error in gcc 4.9.4.
  2020-07-31  9:07 [PATCH v3] target/arm: Fix compile error in gcc 4.9.4 Kaige Li
@ 2020-07-31  9:20 ` Peter Maydell
  2020-07-31  9:27   ` Kaige Li
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2020-07-31  9:20 UTC (permalink / raw)
  To: Kaige Li; +Cc: qemu-arm, QEMU Developers

On Fri, 31 Jul 2020 at 10:07, Kaige Li <likaige@loongson.cn> wrote:
>
> 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
>
> Add an initiallization value NULL for fn to fix this.

As I said, I've already applied this patch to target-arm.next,
so you don't need to do anything further. It'll get into
master probably on Monday.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] target/arm: Fix compile error in gcc 4.9.4.
  2020-07-31  9:20 ` Peter Maydell
@ 2020-07-31  9:27   ` Kaige Li
  0 siblings, 0 replies; 3+ messages in thread
From: Kaige Li @ 2020-07-31  9:27 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, QEMU Developers

On 07/31/2020 05:20 PM, Peter Maydell wrote:

> On Fri, 31 Jul 2020 at 10:07, Kaige Li <likaige@loongson.cn> wrote:
>> 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
>>
>> Add an initiallization value NULL for fn to fix this.
> As I said, I've already applied this patch to target-arm.next,
> so you don't need to do anything further. It'll get into
> master probably on Monday.
Ok, Thank you.
Kaige.
>
> thanks
> -- PMM



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  9:07 [PATCH v3] target/arm: Fix compile error in gcc 4.9.4 Kaige Li
2020-07-31  9:20 ` Peter Maydell
2020-07-31  9:27   ` Kaige Li

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git