qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v2 2/3] target/hexagon: fix some occurrences of -Wshadow=loca


From: ltaylorsimpson
Subject: RE: [PATCH v2 2/3] target/hexagon: fix some occurrences of -Wshadow=local
Date: Fri, 6 Oct 2023 08:59:29 -0600


> -----Original Message-----
> From: Brian Cain <bcain@quicinc.com>
> Sent: Thursday, October 5, 2023 4:22 PM
> To: qemu-devel@nongnu.org
> Cc: bcain@quicinc.com; armbru@redhat.com; richard.henderson@linaro.org;
> philmd@linaro.org; peter.maydell@linaro.org; quic_mathbern@quicinc.com;
> stefanha@redhat.com; ale@rev.ng; anjo@rev.ng;
> quic_mliebel@quicinc.com; ltaylorsimpson@gmail.com
> Subject: [PATCH v2 2/3] target/hexagon: fix some occurrences of -
> Wshadow=local
> 
> Of the changes in this commit, the changes in
> `HELPER(commit_hvx_stores)()` are less obvious.  They are required because
> of some macro invocations like SCATTER_OP_WRITE_TO_MEM().
> 
> e.g.:
> 
>     In file included from ../target/hexagon/op_helper.c:31:
>     ../target/hexagon/mmvec/macros.h:205:18: error: declaration of ‘i’
> shadows a previous local [-Werror=shadow=compatible-local]
>       205 |         for (int i = 0; i < sizeof(MMVector); i += sizeof(TYPE)) 
> { \
>           |                  ^
>     ../target/hexagon/op_helper.c:157:17: note: in expansion of macro
> ‘SCATTER_OP_WRITE_TO_MEM’
>       157 |                 SCATTER_OP_WRITE_TO_MEM(uint16_t);
>           |                 ^~~~~~~~~~~~~~~~~~~~~~~
>     ../target/hexagon/op_helper.c:135:9: note: shadowed declaration is here
>       135 |     int i;
>           |         ^
>     In file included from ../target/hexagon/op_helper.c:31:
>     ../target/hexagon/mmvec/macros.h:204:19: error: declaration of ‘ra’
> shadows a previous local [-Werror=shadow=compatible-local]
>       204 |         uintptr_t ra = GETPC(); \
>           |                   ^~
>     ../target/hexagon/op_helper.c:160:17: note: in expansion of macro
> ‘SCATTER_OP_WRITE_TO_MEM’
>       160 |                 SCATTER_OP_WRITE_TO_MEM(uint32_t);
>           |                 ^~~~~~~~~~~~~~~~~~~~~~~
>     ../target/hexagon/op_helper.c:134:15: note: shadowed declaration is here
>       134 |     uintptr_t ra = GETPC();
>           |               ^~
> 
> Reviewed-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
> Signed-off-by: Brian Cain <bcain@quicinc.com>
> ---
>  target/hexagon/imported/alu.idef | 6 +++---
>  target/hexagon/mmvec/macros.h    | 6 +++---
>  target/hexagon/op_helper.c       | 9 +++------
>  target/hexagon/translate.c       | 9 ++++-----
>  4 files changed, 13 insertions(+), 17 deletions(-)

Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]