Warn on redundant call to exec_static_constructors()

This commit is contained in:
Christian Helmuth 2018-04-03 17:09:47 +02:00
parent b3791fabc2
commit 92edcb17e5
3 changed files with 4 additions and 6 deletions

View File

@ -653,6 +653,10 @@ void Genode::init_ldso_phdr(Env &env)
void Genode::exec_static_constructors()
{
if (!binary_ptr->static_construction_pending())
warning("Don't call Genode::Env::exec_static_constructors() "
"in components without static globals");
binary_ptr->finish_static_construction();
}

View File

@ -504,8 +504,5 @@ struct Nitlog::Main
void Component::construct(Genode::Env &env)
{
/* XXX execute constructors of global statics */
env.exec_static_constructors();
static Nitlog::Main main(env);
}

View File

@ -579,8 +579,5 @@ void Nitpicker::Main::_handle_fb_mode()
void Component::construct(Genode::Env &env)
{
/* XXX execute constructors of global statics */
env.exec_static_constructors();
static Nitpicker::Main nitpicker(env);
}