Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/auto_init: initialize app code from auto_init [RFC] #8274

Closed
wants to merge 1 commit into from

Conversation

vincent-d
Copy link
Member

Contribution description

A new weak function auto_init_app is called at the end of the auto_init
function to let the app initializing its own modules before main is
called.

This is a RFC. My main goal is to make the initialization of our different app and modules more generic and transparent.
So far we call our own 'auto_init' from the beginning of main, but it would be more transparent to use this hook.

Issues/PRs references

None

A new weak function auto_init_app is called at the end of the auto_init
function to let the app initializing its own modules before main is
called.
@vincent-d vincent-d added the Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR label Dec 18, 2017
@kaspar030
Copy link
Contributor

My main goal is to make the initialization of our different app and modules more generic and transparent.

I must say I don't see the benefits outweigh the problems this might cause:

  • we'll have users not using this but use their own explicitly called init function. Do we make them use auto_init_app for consistency?
  • we might soon introduce "multi-app" builds. Those would need to be changed, as this concept only allows one auto_init_app
  • without linking fixes, this breaks if auto_init_app is the only used symbol of the compilation unit it is defined (see make: fix linking #5757). So there will either be frustrated or help-searching users. ;)

#7523 will allow AUTO_INIT(myfunc, priority); in any compilation unit, would that serve your needs?

@vincent-d
Copy link
Member Author

I guess #7523 is a better solution, indeed. Let's close this.

@vincent-d vincent-d closed this Dec 18, 2017
@vincent-d vincent-d deleted the pr/auto_init_app branch January 9, 2018 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants