On Wed, 19 Sep 2012 16:25:46 -0400, Øivind <oivind....@gmail.com> wrote:

I am struggeling to get around the cycle detection kicking in when I have static init in modules that depend on eachother.

I have seen some threads on 'fixes' for this, e.g. adding a @standalone property to the module or similar. Has there been any progress on this?

No. If two initializations truly don't depend on each other, you can initialize in their own module.

The issue is that you have to move *all* the initializations into their own module. The compiler doesn't keep track of complex dependencies, it's all on a module-level.

I redesigned the static cycle detection code a while back (it was broken (allowed certain cycles) and much less informative), and I can say it was a very difficult problem to solve.

If not would it be possible in e.g. main() to get a list of all compiled-in modules, and then iterate over them and call an init function where it exists? As long as there is a way to list the name of the modules at compile-time, this should be pretty easy..?

No, you have no idea at compile-time what other modules will be linked in.

You need to do the cycle detection at link-time or run-time, and as long as we use standard C linkers, we cannot add that feature.

-Steve

Reply via email to