out vs. var (was: Re: [fpc-devel] Internal error in FPC 2.6.0rc1)
Jonas Maebe
jonas.maebe at elis.ugent.be
Mon Nov 28 01:05:46 CET 2011
On 28 Nov 2011, at 00:49, Michael Müller wrote:
> Does this mean that reference counted elements are emptied and the others not?
Yes.
> Beside that what is than the difference between 'out' and 'var'?
If you enable hints, the compiler will print a hint if it detects you passing a potentially uninitialized variable to a "var" parameter, while it won't print such a warning if you pass it to an "out" parameter. Additionally, if you use the -gt command line option then the compiler will overwrite the contents of (non-reference-counted) out-parameters in the function entry code. This switch will do nothing for open array parameters though, because it lacks support for using the hidden "high" parameter to determine the bounds of the array at run time.
Jonas
More information about the fpc-devel
mailing list