At 9:47 AM +0200 5/7/03, Maurice Lombardi wrote:
Peter N Lewis a écrit:
CodeWarrior actually would detect this and give a warning "possible use before assignment" which is very nice. CodeWarrior also detects unused parameters in procedures/functions (with an {$unused( whatever )} construct to silence the warning). These are both useful warnings, so consider it a feature request for the todo list (or wish list or whatever) if it's not already there.
use -Wall
Does not do anything for me:
program testpas9;
procedure test( a, b: Integer ); begin WriteLn( a ); end;
var i: Integer; begin Inc(i); WriteLn( i ); test( i, i * 2 ); end.
gpc -Wall -o testpas9 testpas9.pas
generates no warnings about the unused b nor any warning about the used before defined i.
Enjoy, Peter.
-- http://www.interarchy.com/ http://documentation.interarchy.com/