[Qemu-devel] [PATCH] disas/microblaze: Remove unused REG_SP macro

Richard Henderson posted 1 patch 6 years, 10 months ago
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181220043315.8848-1-richard.henderson@linaro.org
disas/microblaze.c | 1 -
1 file changed, 1 deletion(-)
[Qemu-devel] [PATCH] disas/microblaze: Remove unused REG_SP macro
Posted by Richard Henderson 6 years, 10 months ago
This causes a build error with debian sid, riscv64 host:

disas/microblaze.c:179: error: "REG_SP" redefined [-Werror]
 #define REG_SP  1 /* stack pointer */

In file included from /usr/include/signal.h:306,
                 from include/qemu/osdep.h:101,
                 from disas/microblaze.c:36:
/usr/include/riscv64-linux-gnu/sys/ucontext.h:36: note: this is the location of the previous definition
 # define REG_SP 2

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 disas/microblaze.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/disas/microblaze.c b/disas/microblaze.c
index 598ecbc89d..c23605043a 100644
--- a/disas/microblaze.c
+++ b/disas/microblaze.c
@@ -176,7 +176,6 @@ enum microblaze_instr_type {
 #define REG_TLBSX 36869 /* MMU: TLB Search Index reg */
 
 /* alternate names for gen purpose regs */
-#define REG_SP  1 /* stack pointer */
 #define REG_ROSDP 2 /* read-only small data pointer */
 #define REG_RWSDP 13 /* read-write small data pointer */
 
-- 
2.17.2


Re: [Qemu-devel] [PATCH] disas/microblaze: Remove unused REG_SP macro
Posted by Philippe Mathieu-Daudé 6 years, 10 months ago
On 12/20/18 5:33 AM, Richard Henderson wrote:
> This causes a build error with debian sid, riscv64 host:
> 
> disas/microblaze.c:179: error: "REG_SP" redefined [-Werror]
>  #define REG_SP  1 /* stack pointer */
> 
> In file included from /usr/include/signal.h:306,
>                  from include/qemu/osdep.h:101,
>                  from disas/microblaze.c:36:
> /usr/include/riscv64-linux-gnu/sys/ucontext.h:36: note: this is the location of the previous definition
>  # define REG_SP 2
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  disas/microblaze.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/disas/microblaze.c b/disas/microblaze.c
> index 598ecbc89d..c23605043a 100644
> --- a/disas/microblaze.c
> +++ b/disas/microblaze.c
> @@ -176,7 +176,6 @@ enum microblaze_instr_type {
>  #define REG_TLBSX 36869 /* MMU: TLB Search Index reg */
>  
>  /* alternate names for gen purpose regs */
> -#define REG_SP  1 /* stack pointer */

This is clever than my previous suggestion:
https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg00171.html

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>  #define REG_ROSDP 2 /* read-only small data pointer */
>  #define REG_RWSDP 13 /* read-write small data pointer */
>  
>