Peter N Lewis a écrit:
var
c: CSPtr;
Since c is a pointer where does it point?
begin Inc(CSPtr(c)); end.
If you increment c just where does it point?
It's just an example, a minimal example that generates the error to make it as easy as possible to find the cause. The actual code was in a C String to PString routine and did indeed assign the variable a value first.
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
Maurice