On 28 Nov 2009, at 22:34, Michael Van Canneyt wrote:

> It was Jonas Maebe (Jonas, correct me if I'm wrong) who pointed
> out (already some time ago) that this behaviour is purely coincidental (but 
> admittedly convenient), and should not be taken for granted.

That's correct,

Usually, this is brought up in the context of the warning
  Variable "yyy" does not seem to be initialized

in reference to a global variable. The argument is that this warning is wrong 
in that context, since it is actually initialised (with 0). While the answer 
that this is not guaranteed is correct in theory (as in "in terms of what the 
Pascal standard mandates"), the fact that TP and Delphi do guarantee this and 
that many people rely on this behaviour probably means that we will also always 
guarantee it.
 
Maybe we should simply reword the warning to read
  Variable "yyy" may be read before it is written

or something similar (although that's not directly relevant to this discussion).


Jonas

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to