Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

Paolo Bonzini
2011-05-25T15:38:08Z

On 05/25/2011 02:53 PM, Ingo Molnar wrote:
> Obviously the compiler did not provide this feature into a vacuum, it
> expected the C library to execute constructors, right?
>
> So the above dodges my question of why there is no method (in glibc)
> to turn auto-execution off and let the app do it.

Well, I wasn't there. :)

I suppose they simply chose those semantics for C++ constructors which
were easiest to implement (i.e. execute before main). ((constructor))
then followed suit.

Any further extension in the direction you suggest would have to be
designed very carefully in order to coexist with C++ constructors, or it
would have to be something completely separate... in the latter case,
((constructor)) already provides the ingredients to do this, even if at
a small cost in efficiency. So there is no big incentive to add this
further extension to the compiler and/or the C library.

Paolo