build errors on s390 tcg
With todays qemu git I get the following error when compiling for s390:
In file included from /home/cborntra/REPOS/qemu/tcg/tcg.c:175:0:/home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:677:13: error: conflicting types for ‘tcg_out_mov’ /home/cborntra/REPOS/qemu/tcg/tcg.c:76:13: note: previous declaration of ‘tcg_out_mov’ was here /home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:689:13: error: conflicting types for ‘tcg_out_movi’ /home/cborntra/REPOS/qemu/tcg/tcg.c:77:13: note: previous declaration of ‘tcg_out_movi’ was here /home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:829:20: error: conflicting types for ‘tcg_out_ld’ /home/cborntra/REPOS/qemu/tcg/tcg.c:74:13: note: previous declaration of ‘tcg_out_ld’ was here /home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:839:20: error: conflicting types for ‘tcg_out_st’ /home/cborntra/REPOS/qemu/tcg/tcg.c:81:13: note: previous declaration of ‘tcg_out_st’ was here make[1]: *** [tcg/tcg.o] Error 1
reverting c0ad3001bf12292b137b05e1c4643f31c6b0a727 ""tcg: Add forward declarations for local functions" solves the problem, but it just hides the problem. Any ideas howto solve that properly?
Christian
Quoted 13 lines · Christian Borntraeger
With todays qemu git I get the following error when compiling for s390:
In file included from
/home/cborntra/REPOS/qemu/tcg/tcg.c:175:0:/home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:677:13: error: conflicting types for ‘tcg_out_mov’/home/cborntra/REPOS/qemu/tcg/tcg.c:76:13: note: previous declaration of ‘tcg_out_mov’ was here/home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:689:13: error: conflicting types for ‘tcg_out_movi’/home/cborntra/REPOS/qemu/tcg/tcg.c:77:13: note: previous declaration of ‘tcg_out_movi’ was here/home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:829:20: error: conflicting types for ‘tcg_out_ld’/home/cborntra/REPOS/qemu/tcg/tcg.c:74:13: note: previous declaration of ‘tcg_out_ld’ was here/home/cborntra/REPOS/qemu/tcg/s390/tcg-target.c:839:20: error: conflicting types for ‘tcg_out_st’/home/cborntra/REPOS/qemu/tcg/tcg.c:81:13: note: previous declaration of ‘tcg_out_st’ was here make[1]: *** [tcg/tcg.o] Error 1
Quoted 2 lines
reverting
c0ad3001bf12292b137b05e1c4643f31c6b0a727""tcg: Add forward declarations for local functions" solves the problem, but it just hides the problem. Any ideas howto solve that properly?
The problem is that tcg.c defines the functions with int arguments for TCG register indexes, while s390/tcg-target.c takes TCGReg parameters. I'm not sure which way is better, but using TCGReg feels more type safe to me.
Alex
Quoted 3 lines · Alexander Graf
The problem is that
tcg.cdefines the functions with int arguments for TCG register indexes, whiles390/tcg-target.ctakes TCGReg parameters. I'm not sure which way is better, but using TCGReg feels more type safe to me.
You're not consistent, though; for example the s390 tcg_target_reg_alloc_order array is declared as int[], not TCGReg[].
-- PMM
Am 04.10.2011 14:44, schrieb Peter Maydell:
Quoted 9 lines · Alexander Graf
Quoted 3 lines
The problem is that
tcg.cdefines the functions with int arguments for TCG register indexes, whiles390/tcg-target.ctakes TCGReg parameters. I'm not sure which way is better, but using TCGReg feels more type safe to me.You're not consistent, though; for example the s390
tcg_target_reg_alloc_orderarray is declared as int[], not TCGReg[].-- PMM
I did not notice that s390 was different when I wrote my patch, but I agree with Alex that TCGReg is more type safe. I also think that using TCGReg documents the meaning of a parameter better than using a simple int.
So there are two tasks to be done:
- Look for inconsistencies and fix them.
- Add and use TCGReg for all other targets, too.
Or are there any reasons why we should keep the int type parameters?
Regards,
Stefan Weil