On 27/01/19 14:11, Walter Prins wrote:
Would it perhaps be possible to treat this as a type of optimization however? Which is to say, if the called routine makes no changes to the passed record, then it should not matter whether compiler implicitly const passes the parameter or copies it?
It does, because another routine called by this routine may modify the original record.
E.g. var r: record a: longint end;; procedure modify; begin r.a:=2; end; procedure test(r: trecord); begin modify; if r.a<>1 then writeln('error'); end; begin r.a:=1; test(r); end. Jonas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel