[fpc-pascal] Class constructor called unconditionally
vojtech.cihak at atlas.cz
Thu Mar 31 15:58:33 CEST 2016
IMO compilers should be dogmatic otherwise one cannot rely on them. This looks to me like advocating wrong optimization.
> Od: silvioprog <silvioprog at gmail.com>
> Komu: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
> Datum: 31.03.2016 15:33
> Předmět: [fpc-pascal] Class constructor called unconditionally
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.--
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal