Skip to contentSkip to conversation

gccism's are ok?

Qemu-devel Gerd Hoffmann 5 participants 5 messages Aug 11, 2008 – Aug 12, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

Quick question: Is it ok to use gcc-specific features in qemu? Or will that break builds on some platform?

Linux obviously is gcc, MacOS X too as far I know. MinGW on Windows is gcc too. Anything else we care about?

I'm thinking especially about the constructor attribute. That would allow to make drivers self-contained, by having a register() call in a small constructor function ...

cheers,
Gerd

Signature · 1 line
http://kraxel.fedorapeople.org/xenner/
#1 lore raw
Quoted 11 lines · Gerd Hoffmann

Hi,

Quick question: Is it ok to use gcc-specific features in qemu? Or will that break builds on some platform?

Linux obviously is gcc, MacOS X too as far I know. MinGW on Windows is gcc too. Anything else we care about?

I'm thinking especially about the constructor attribute. That would allow to make drivers self-contained, by having a register() call in a small constructor function ...

I'm doing that in QEMUAccel, and although I'm also not sure how well it'll go, nobody complained
so far.

Quoted 9 lines

cheers,
Gerd

--
http://kraxel.fedorapeople.org/xenner/

Signature · 5 lines
Glauber Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
#2 lore raw
In reply to Gerd Hoffmann
Quoted 5 lines · Gerd Hoffmann

Hi,

Quick question: Is it ok to use gcc-specific features in qemu? Or will that break builds on some platform?

Quoted 7 lines

Linux obviously is gcc, MacOS X too as far I know. MinGW on Windows is gcc too. Anything else we care about?

I'm thinking especially about the constructor attribute. That would allow to make drivers self-contained, by having a register() call in a small constructor function ...

You'll have to post a patch. I had discussed using GCC-isms to do the same thing with Paul Brook and at the time, he was not a big fan of it IIRC.

Regards,

Anthony Liguori

Quoted 4 lines

cheers,
Gerd

#3 lore raw

Hi,

Quoted 8 lines · Anthony Liguori
Quoted 6 lines · Gerd Hoffmann

Quick question: Is it ok to use gcc-specific features in qemu? Or will that break builds on some platform?

Linux obviously is gcc, MacOS X too as far I know. MinGW on Windows is gcc too. Anything else we care about?

Quoted 8 lines
Quoted 4 lines

I'm thinking especially about the constructor attribute. That would allow to make drivers self-contained, by having a register() call in a small constructor function ...

You'll have to post a patch. I had discussed using GCC-isms to do the same thing with Paul Brook and at the time, he was not a big fan of it IIRC.

Concretely for the suggestion to replace the nice, deterministic and straight-forward registering of drivers with a gcc dependent, unintuitive and hard to debug solution, I maintain that it is not a good idea, and this has nothing to do with the usage of a gccism.

Ciao,
Dscho

#4 lore raw
In reply to Gerd Hoffmann
Quoted 7 lines · Gerd Hoffmann

Hi,

Quick question: Is it ok to use gcc-specific features in qemu? Or will that break builds on some platform?

Linux obviously is gcc, MacOS X too as far I know. MinGW on Windows is gcc too. Anything else we care about?

The dyngen targets still require gcc3 to build, OTOH making qemu more portable is valuable. I believe the policy should be "avoid compiler extensions unless it is hard to do without".

Quoted 3 lines

I'm thinking especially about the constructor attribute. That would allow to make drivers self-contained, by having a register() call in a small constructor function ...

This idea is IMHO of dubious value. It obfuscates the control flow, and it wouldn't work for a plugin system (where self-containedness would be the biggest win).

Thiemo