Scott Moore wrote:
The problem is, that using variables may only delay the problem:
procedure dummy(x, y: integer);
var a: integer;
begin
a := x; a := y
end;
(or similar), would work today, then tomorrow when the compiler gets better dead code elimination, it figgures out that a isn't used for anything, and you are back to getting the warning. No matter how complex the code you use to attempt to "fool" the compiler into thinking you are using the var, there is always a higher level opto that can figgure out that you aren't doing real work.
IP Pascal uses:
procedure dummy(x, y: integer);
var a: integer;
begin
reference(x); reference(y)
end;
Which is straightforward. Reference is a built-in that sets the variable as referenced.
I basically agree. Can your `reference' also be used to throw away unwanted function results, or is it only for variables?
Frank