<p style="padding:0 0 0 0; margin:0 0 0 0;">IMO compilers should be dogmatic otherwise one cannot rely on them. This looks to me like advocating wrong optimization.</p>

<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>

<p style="padding:0 0 0 0; margin:0 0 0 0;">Blaazen</p>

<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: silvioprog <silvioprog@gmail.com><br />
> Komu: "FPC-Pascal users discussions" <fpc-pascal@lists.freepascal.org><br />
> Datum: 31.03.2016 15:33<br />
> Předmět: [fpc-pascal] Class constructor called unconditionally<br />
></p>

<div dir="ltr">
<div>
<div> As long as you don't use the class anywhere outside the class itself, the compiler takes this as the class not used at all and hence won't call the class constructor. So I guess you have to use the intialization section instead of tweaking the code to fool the compiler. Take the pragmatic approach instead of the dogmatic one. It will be more readable anyway.</div>
-- <br />

<div class="gmail_signature">
<div dir="ltr">
<div>Silvio Clécio</div>
</div>
</div>
</div>
</div>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><br />
<br />
----------<br />
<br />
_______________________________________________<br />
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org<br />
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a></p>