[Oberon] Initial value of variables, where specified?
Chris Burrows
chris at cfbsoftware.com
Wed Feb 12 20:30:51 CET 2020
Rochus,
There have been previous discussions here on the pros and cons of
initialising local variables. E.g. 4 Mar 2019:
[Oberon] Should one automatically initalize (sic) local pointer or procedure
variables (safety precaution)?
http://lists.inf.ethz.ch/pipermail/oberon/2019/013120.html
Regards,
Chris Burrows
CFB Software
https://www.astrobe.com
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Joerg
> Sent: Thursday, 13 February 2020 3:58 AM
> To: rochus.keller at bluewin.ch; 'ETH Oberon and related systems'
> Subject: Re: [Oberon] Initial value of variables, where specified?
>
> Rochus
> Global module variables are initialized to zero as well; this is done
> in
> Modules.Load()
> The local variables (on the stack) are not initialized!! So their
> value is undefined aka random.
> Jörg
>
> -----Original Message-----
> From: Oberon <oberon-bounces at lists.inf.ethz.ch> On Behalf Of
> rochus.keller at bluewin.ch
> Sent: Wednesday, February 12, 2020 6:04 PM
> To: oberon at lists.inf.ethz.ch
> Subject: Re: [Oberon] Initial value of variables, where specified?
>
> @ Paul Reed & Joerg Straube
>
> Thank you very much for your feedback. I will have a look at it
> again. At least zeroing the record members allocated with NEW already
> helped.
>
> Best
> R.
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related
> systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related
> systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
More information about the Oberon
mailing list