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.
CBFalconer wrote:
Peter N Lewis wrote:
... snip ...
BTW, what do you do with unwanted function results in MW? Does `{$unused}' also apply there?
No. {$unused(x,y,z)} accepts variable names only.
MW Pascal has no solution for throwing away unwanted results.
The standard Pascal solution is to define a variable named 'junk' (or whatever else floats your boat) and put all such items there.