can we detect at compile time module ctor/dtor cycles ?

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 18 06:01:11 PDT 2013


On Mon, 17 Jun 2013 21:19:57 -0400, Timothee Cour  
<thelastmammoth at gmail.com> wrote:

> I understand your point, however I argued above that we should run a test
> at compile time to detect cycles. It won't catch all cycles (because of
> certain di files), but it will catch most of them (at least all of the  
> ones
> not involving di files). This would be especially handy for people using
> rdmd.
> At runtime, we will also run the test to catch all cases.

rdmd could, as an extra step, generate a program that simply exits with 0,  
to check all cycles.  Then run that as part of compilation step.

There isn't a whole lot of difference between checking at compile time and  
checking at runtime before main starts.

-Steve


More information about the Digitalmars-d-learn mailing list