You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/12/01 02:16:58 UTC
[jira] [Commented] (MYNEWT-491) Double calling init functions
should be disallowed
[ https://issues.apache.org/jira/browse/MYNEWT-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15710592#comment-15710592 ]
ASF subversion and git services commented on MYNEWT-491:
--------------------------------------------------------
Commit 0bfa75530ff84b9b471a1bd784ce8eaa8cddbc74 in incubator-mynewt-core's branch refs/heads/develop from [~ccollins476]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-core.git;h=0bfa755 ]
MYNEWT-491 Prevent repeated package initialization
Forgot to commit this file!
> Double calling init functions should be disallowed
> --------------------------------------------------
>
> Key: MYNEWT-491
> URL: https://issues.apache.org/jira/browse/MYNEWT-491
> Project: Mynewt
> Issue Type: Improvement
> Components: Sysinit
> Affects Versions: v1_0_0_beta1
> Reporter: Sterling Hughes
> Assignee: Christopher Collins
> Fix For: v1_0_0_rel
>
>
> When "init" functions are specified to sysinit, that should be the only place they are called. They should not be directly called, or bad things happen.
> There should be a macro SYSINIT_ASSERT_CALLED_ONCE() (name it better), at the beginning of these init functions, that asserts on double init. It can be hard to debug when this function is called twice, and I think it will be very common for users to not notice the init function exported by the package, and instead call it directly, so we should find helpful ways to inform them (at least when build_profile=debug).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)