It is similar to type tarray = array [1..10] of longint; procedure p(const a1 : tarray;var a2 : tarray); begin a2[1]:=4321; writeln(a1[1]); // surprise end; var arr : tarray; begin arr[1]:=1234; p(arr,arr); end. The only way to prevent this (of course, such a simple case could be detected by the compiler but one can always construct an example which works around this detection), is to turn off the const optimization that const allows the compiler to pass only a reference, but I am pretty sure, people will not be happy about this :)
Correct. Would definitely not be happy about this. :)
- Dennis _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
