[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 6/9] target/sparc/win_helper: silence the compiler warnings
From: |
Chenqun (kuhn) |
Subject: |
RE: [PATCH 6/9] target/sparc/win_helper: silence the compiler warnings |
Date: |
Thu, 29 Oct 2020 02:45:44 +0000 |
> -----Original Message-----
> From: Philippe Mathieu-Daudé [mailto:philippe.mathieu.daude@gmail.com]
> On Behalf Of Philippe Mathieu-Daudé
> Sent: Wednesday, October 28, 2020 5:51 PM
> To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-devel@nongnu.org;
> qemu-trivial@nongnu.org
> Cc: Zhanghailiang <zhang.zhanghailiang@huawei.com>; Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk>; ganqixin <ganqixin@huawei.com>; Euler
> Robot <euler.robot@huawei.com>; Artyom Tarasenko
> <atar4qemu@gmail.com>
> Subject: Re: [PATCH 6/9] target/sparc/win_helper: silence the compiler
> warnings
>
> On 10/28/20 5:18 AM, Chen Qun wrote:
> > When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed
> warning:
> > target/sparc/win_helper.c: In function ‘get_gregset’:
> > target/sparc/win_helper.c:304:9: warning: this statement may fall through
> [-Wimplicit-fallthrough=]
> > 304 | trace_win_helper_gregset_error(pstate);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > target/sparc/win_helper.c:306:5: note: here
> > 306 | case 0:
> > | ^~~~
> >
> > Add the corresponding "fall through" comment to fix it.
> >
> > Reported-by: Euler Robot <euler.robot@huawei.com>
> > Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> > ---
> > Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> > Cc: Artyom Tarasenko <atar4qemu@gmail.com>
> > ---
> > target/sparc/win_helper.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c
> > index 8290a21142..32eacc05e6 100644
> > --- a/target/sparc/win_helper.c
> > +++ b/target/sparc/win_helper.c
> > @@ -303,6 +303,7 @@ static inline uint64_t *get_gregset(CPUSPARCState
> *env, uint32_t pstate)
> > default:
> > trace_win_helper_gregset_error(pstate);
> > /* pass through to normal set of global registers */
> > + /* fall through */
>
> Can you keep the comment, doing s/pass/fall/?
>
That looks good, too.
Thanks,
Chen Qun
> > case 0:
> > return env->bgregs;
> > case PS_AG:
> >
[PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, Chen Qun, 2020/10/28