Frank Heckenbach wrote:
Waldek Hebisch wrote:
After the patch is applied `fjf490.pas' fails. However, I think that `fjf490.pas' is wrong. At least in standard mode accessing buffer variable when at the end of file is _not_ an error: the postcondition of `get' says that at the end of file value of the file buffer is undefined, and I see no restriction on access to undefined variables.
What about this (6.8.1: Expressions - General):
: When a primary is used, it shall be an error if the variable : denoted by a variable?access of the primary is undefined. : : primary > variable?access
Yes, we may raise error in `fjf490.pas'.
Of course, we could say that we currently don't check for undefined access in general (as a processor is permitted to leave errors undetected), so why should we bother here?
Worse, ATM we fail correct programs (the original report was about a program _writing_ to the buffer variable). AFAICS to properly distinguish read form writes we have to do that in the core compiler. It seems that we could do that using apropriate tree code and delaying expansion of the reference. The question is how much do we care.