* [Qemu-devel] [PATCH] target-alpha: Fix compiler warning for gcc-4.3 (and older)
@ 2009-12-14 9:54 Stefan Weil
2009-12-15 11:57 ` Laurent Desnogues
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2009-12-14 9:54 UTC (permalink / raw)
To: Richard Henderson, Aurelien Jarno, QEMU Developers
"Old" compilers obviously are not able to recognise
that all cases are handled here:
qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function
A small modification helps the compiler to do its jobs.
gcc-4.4 does not need this, but is still not standard on all platforms.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
target-alpha/helper.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/target-alpha/helper.c b/target-alpha/helper.c
index a658f97..be7d37b 100644
--- a/target-alpha/helper.c
+++ b/target-alpha/helper.c
@@ -95,6 +95,7 @@ void cpu_alpha_store_fpcr (CPUState *env, uint64_t val)
round_mode = float_round_nearest_even;
break;
case 3:
+ default: /* this avoids a gcc (< 4.4) warning */
round_mode = float_round_up;
break;
}
--
1.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Qemu-devel] [PATCH] target-alpha: Fix compiler warning for gcc-4.3 (and older)
2009-12-14 9:54 [Qemu-devel] [PATCH] target-alpha: Fix compiler warning for gcc-4.3 (and older) Stefan Weil
@ 2009-12-15 11:57 ` Laurent Desnogues
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Desnogues @ 2009-12-15 11:57 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers, Aurelien Jarno, Richard Henderson
On Mon, Dec 14, 2009 at 10:54 AM, Stefan Weil <weil@mail.berlios.de> wrote:
> "Old" compilers obviously are not able to recognise
> that all cases are handled here:
>
> qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function
>
> A small modification helps the compiler to do its jobs.
>
> gcc-4.4 does not need this, but is still not standard on all platforms.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
> ---
> target-alpha/helper.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/target-alpha/helper.c b/target-alpha/helper.c
> index a658f97..be7d37b 100644
> --- a/target-alpha/helper.c
> +++ b/target-alpha/helper.c
> @@ -95,6 +95,7 @@ void cpu_alpha_store_fpcr (CPUState *env, uint64_t val)
> round_mode = float_round_nearest_even;
> break;
> case 3:
> + default: /* this avoids a gcc (< 4.4) warning */
> round_mode = float_round_up;
> break;
> }
> --
> 1.6.5
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-15 11:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 9:54 [Qemu-devel] [PATCH] target-alpha: Fix compiler warning for gcc-4.3 (and older) Stefan Weil
2009-12-15 11:57 ` Laurent Desnogues
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).