qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] build errors on s390 tcg
@ 2011-10-04 11:54 Christian Borntraeger
  2011-10-04 12:23 ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2011-10-04 11:54 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Stefan Weil, Carsten Otte, Alexander Graf, rth

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] build errors on s390 tcg
  2011-10-04 11:54 [Qemu-devel] build errors on s390 tcg Christian Borntraeger
@ 2011-10-04 12:23 ` Alexander Graf
  2011-10-04 12:44   ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2011-10-04 12:23 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Stefan Weil, Carsten Otte, QEMU Developers, Blue Swirl, rth

On 10/04/2011 01:54 PM, Christian Borntraeger wrote:
> 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?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] build errors on s390 tcg
  2011-10-04 12:23 ` Alexander Graf
@ 2011-10-04 12:44   ` Peter Maydell
  2011-10-04 16:41     ` Stefan Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2011-10-04 12:44 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Carsten Otte, Stefan Weil, QEMU Developers, Blue Swirl,
	Christian Borntraeger, rth

On 4 October 2011 13:23, Alexander Graf <agraf@suse.de> wrote:
> 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.

You're not consistent, though; for example the s390 tcg_target_reg_alloc_order
array is declared as int[], not TCGReg[].

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] build errors on s390 tcg
  2011-10-04 12:44   ` Peter Maydell
@ 2011-10-04 16:41     ` Stefan Weil
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2011-10-04 16:41 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Carsten Otte, Alexander Graf, QEMU Developers, Blue Swirl,
	Christian Borntraeger, rth

Am 04.10.2011 14:44, schrieb Peter Maydell:
> On 4 October 2011 13:23, Alexander Graf <agraf@suse.de> wrote:
>> 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.
>
> You're not consistent, though; for example the s390 
> tcg_target_reg_alloc_order
> array 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-04 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04 11:54 [Qemu-devel] build errors on s390 tcg Christian Borntraeger
2011-10-04 12:23 ` Alexander Graf
2011-10-04 12:44   ` Peter Maydell
2011-10-04 16:41     ` Stefan Weil

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).