Am 20.09.2014 04:40 schrieb "Gennady Agranov" <gennadyagra...@gmail.com>:
>
>
> Hi,
>
> I do not have clear picture about initialization of local variables - are
they initialized to some default value or not - and is there a way to
assure that every local variable (including record types)  is set to some
default?
>
> Of course the safest approach is to assume that everything is not
initialized and filled with garbage.
>
> Is it always true? E.g. is there a way control initialization of record
variables on stack?

Local variables are not initialized, except managed variables like
interfaces, arrays and AFAIK Strings.
You can manually initialize them though like you can global variables (the
generated code is however not much different from initializing them
yourself inside the function body unlike for global variables).

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to