Peter N Lewis wrote:
... snip ...
Which `a' is meant here? The outer one? What if you move the directive after the word `procedure', is it the inner one now? If not, it would seem confusing. If so, it would need to reference an identifier before it's declared, also bad ...
Basically I guess since it is accessing the symbol table it would apply to the same thing the compiler currently considered as the "current in scope variable", which would be ambiguous at best everywhere from "procedure" up to the ";" (and possibly one more token. For myself (and we could certainly recommend it as the way to go), I generally write the {$unused(a,b,c)} line on the first line after the begin. That ensures the compiler and the parser are pretty much guaranteed to be in sync.
Consider:
PROCEDURE foo(bar : integer);
VAR junk : integer;
FUNCTION fee(faw : integer) : integer; BEGIN fee := bar * faw; END;
BEGIN IF something THEN junk := fee(10); END;