qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] c99 or not?
@ 2008-08-17 22:22 Ben Taylor
  2008-08-17 22:33 ` François Revol
  2008-08-17 23:28 ` Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Taylor @ 2008-08-17 22:22 UTC (permalink / raw)
  To: qemu-devel

I've been hacking about on qemu again on Solaris 10, which I've run
into an issue.

in the nbd.h file, it includes stdbool.h, but on Solaris 10, you have
to enable c99
to get this to compile.

This has a rather nasty set of cascading effects, most of which are anonymous
unions in nbd.c and vga_vmware.c, as well asm needing to be __asm
scattered throughout the code.

Thoughts on this?  I already have some prototype code to fix up nbd.c
and vga_vmware.c to get rid of the anonymous unions, but will have some
more work to complete to get a working compile.

Thanks,

Ben

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

* Re: [Qemu-devel] c99 or not?
  2008-08-17 22:22 [Qemu-devel] c99 or not? Ben Taylor
@ 2008-08-17 22:33 ` François Revol
  2008-08-21 21:58   ` Andreas Färber
  2008-08-17 23:28 ` Anthony Liguori
  1 sibling, 1 reply; 6+ messages in thread
From: François Revol @ 2008-08-17 22:33 UTC (permalink / raw)
  To: qemu-devel

> I've been hacking about on qemu again on Solaris 10, which I've run
> into an issue.
>
> in the nbd.h file, it includes stdbool.h, but on Solaris 10, you have
> to enable c99
> to get this to compile.
>
> This has a rather nasty set of cascading effects, most of which are
> anonymous
> unions in nbd.c and vga_vmware.c, as well asm needing to be __asm
> scattered throughout the code.
>
> Thoughts on this?  I already have some prototype code to fix up nbd.c
> and vga_vmware.c to get rid of the anonymous unions, but will have
> some
> more work to complete to get a working compile.
>

As a BeOS and Haiku dev, I'm used to having to "fix" apps back to c89
to get them working with gcc2 because we are forced to stick to it due
to the C++ ABI breackage.
Haiku shall also provice gcc4 soon, and it might be possible to get
gcc4 usable under BeOS, but it's like hunting a fly with a hand
grenade.

Now, I didn't try to build QEMU on BeOS for quite some time, not even
sure it'd still build. I don't know if Mickael Lotz (BeOS port
maintainer IIRC) has recent builds either.
Still, avoiding C99 if possible would help, and possibly other
platforms.

François.

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

* Re: [Qemu-devel] c99 or not?
  2008-08-17 22:22 [Qemu-devel] c99 or not? Ben Taylor
  2008-08-17 22:33 ` François Revol
@ 2008-08-17 23:28 ` Anthony Liguori
  2008-08-17 23:34   ` Ben Taylor
  1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2008-08-17 23:28 UTC (permalink / raw)
  To: qemu-devel

Ben Taylor wrote:
> I've been hacking about on qemu again on Solaris 10, which I've run
> into an issue.
>
> in the nbd.h file, it includes stdbool.h, but on Solaris 10, you have
> to enable c99
> to get this to compile.
>   

Are you not using GCC?  QEMU is not known to support any compilers other 
than GCC.

Perhaps you need to specify -std=gnu99 instead of -std=c99?

Regards,

Anthony Liguori

> This has a rather nasty set of cascading effects, most of which are anonymous
> unions in nbd.c and vga_vmware.c, as well asm needing to be __asm
> scattered throughout the code.
>
> Thoughts on this?  I already have some prototype code to fix up nbd.c
> and vga_vmware.c to get rid of the anonymous unions, but will have some
> more work to complete to get a working compile.
>
> Thanks,
>
> Ben
>
>
>   

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

* Re: [Qemu-devel] c99 or not?
  2008-08-17 23:28 ` Anthony Liguori
@ 2008-08-17 23:34   ` Ben Taylor
  2008-08-21 19:43     ` Andreas Färber
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Taylor @ 2008-08-17 23:34 UTC (permalink / raw)
  To: qemu-devel

On Sun, Aug 17, 2008 at 7:28 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> Ben Taylor wrote:
>>
>> I've been hacking about on qemu again on Solaris 10, which I've run
>> into an issue.
>>
>> in the nbd.h file, it includes stdbool.h, but on Solaris 10, you have
>> to enable c99
>> to get this to compile.
>>
>
> Are you not using GCC?  QEMU is not known to support any compilers other
> than GCC.

gcc-3.4.3.  though once the tcg conversion is complete, I want to
give studio 12 a whirl.

> Perhaps you need to specify -std=gnu99 instead of -std=c99?

I'll give that a shot.

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

* Re: [Qemu-devel] c99 or not?
  2008-08-17 23:34   ` Ben Taylor
@ 2008-08-21 19:43     ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2008-08-21 19:43 UTC (permalink / raw)
  To: qemu-devel


Am 18.08.2008 um 01:34 schrieb Ben Taylor:

> On Sun, Aug 17, 2008 at 7:28 PM, Anthony Liguori <anthony@codemonkey.ws 
> > wrote:
>> Ben Taylor wrote:
>>>
>>> I've been hacking about on qemu again on Solaris 10, which I've run
>>> into an issue.
>>>
>>> in the nbd.h file, it includes stdbool.h, but on Solaris 10, you  
>>> have
>>> to enable c99
>>> to get this to compile.
>>>
>>
>> Are you not using GCC?  QEMU is not known to support any compilers  
>> other
>> than GCC.
>
> gcc-3.4.3.  though once the tcg conversion is complete, I want to
> give studio 12 a whirl.
>
>> Perhaps you need to specify -std=gnu99 instead of -std=c99?
>
> I'll give that a shot.

-std=gnu99 takes me further on S10, but compilation fails in cpu- 
exec.c:694 with "error: bp cannot be used in asm here".

There are also a lot of redefinition warnings for isnormal, isgreater  
etc. between Solaris' math[_c99].h and softfloat[_native].h.

Andreas

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

* Re: [Qemu-devel] c99 or not?
  2008-08-17 22:33 ` François Revol
@ 2008-08-21 21:58   ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2008-08-21 21:58 UTC (permalink / raw)
  To: qemu-devel, François Revol


Am 18.08.2008 um 00:33 schrieb François Revol:

> As a BeOS and Haiku dev, I'm used to having to "fix" apps back to c89
> to get them working with gcc2 because we are forced to stick to it due
> to the C++ ABI breackage.
> Haiku shall also provice gcc4 soon, and it might be possible to get
> gcc4 usable under BeOS, but it's like hunting a fly with a hand
> grenade.

It's not just about where variables are declared or how fields are  
initialized, but also some assumptions that cannot safely be made in  
ANSI C (iirc someone from Plan 9 had complained, too). Anyway, a lot  
of code has recently been reworked to consequently use C99 features,  
so reverting those is unlikely to happen.

QEMU doesn't use C++ to my knowledge, so it should work just fine  
across ABIs. Just means you'd currently have to cross-compile for  
Haiku. TCG and the recent addition of a --disable-aio switch for  
OpenBSD should help with that if you want to do it.

> I didn't try to build QEMU on BeOS for quite some time, not even
> sure it'd still build. I don't know if Mickael Lotz (BeOS port
> maintainer IIRC) has recent builds either.

Michael has apparently posted 0.9.1 on BeBits:
http://www.bebits.com/app/4208

Didn't try it though, I rather run BeOS or Haiku as guests. Michael  
said his patches were very intrusive, so he doesn't post them here.

Andreas

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

end of thread, other threads:[~2008-08-21 21:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-17 22:22 [Qemu-devel] c99 or not? Ben Taylor
2008-08-17 22:33 ` François Revol
2008-08-21 21:58   ` Andreas Färber
2008-08-17 23:28 ` Anthony Liguori
2008-08-17 23:34   ` Ben Taylor
2008-08-21 19:43     ` Andreas Färber

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