<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 31, 2016 at 11:28 AM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:</div><div class="gmail_quote">[...]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I suspect the problem is not in the mode, but in detecting whether a class is used<br>
or not in a program. It becomes very complicated when you use e.g. run-time packages.<br></blockquote><div><br></div><div>Hm... so FPC class constructor (or class initialization) works like unit initialization.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Delphi itself is buggy in this regard, and has been since at least D7.<br>
For this reason, in general I advise against extensive use of initialization sections etc...</blockquote><div><br></div><div>Thanks for sharing this information.</div><div><br></div><div>It's hard to make test-case when the code has an extensive use of initialization sections, so currently I'm avoiding it too. However, I need to register some classes in a class list, so I'm changing my code to do it in some place like application initialization.</div><div><br></div></div>--<br><div class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>