[fpc-devel] Improper OUT usage.

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Mar 11 15:08:27 CET 2013


Jonas Maebe schrieb:
> On 10 Mar 2013, at 22:08, Sven Barth wrote:
> 
>> On 10.03.2013 20:39, Flávio Etrusco wrote:
>>> I'd really like the compiler would stop with an error if it can't
>>> prove a variable/out/result is initialized.
>>> Did anybody try implementing this in FPC?
>> Have fun fixing the errors then:
> 
> I thought he meant inside the routine with the out-parameter, i.e. add a similar check for out-parameters as for function results. On the caller side it doesn't matter whether or not the out-parameter is already initialized.

IMO Out and Var parameters differ only in the handling of the "possibly 
missing initialization" warning. For Var parameters the check is made in 
caller code, for Out parameters in the called subroutine.

DoDi




More information about the fpc-devel mailing list