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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html