Dave Storrs wrote:
> 
> On Wed, 20 Sep 2000, Eric Roode wrote:
> 
> >     foo();
> >     print $x;
> >
> > Generate a warning, or not?  Which one? Remember, foo() may initialize $x.
> 
>         My suggest (FWIW) would be that, if there is no execution path
> which leads to $x being defined in the second line, then a "Use of
> uninit'd variable $x" warning should be thrown at compile time.  If there
> is at least one path that will result in $x being defined AND at least one
> path that will result in it being undefined, the compile-time warning
> could be something like "Possible use of undefined variable $x" or "Not
> all execution paths leave $x defined".

Makes sense. Just have to be careful to describe all this stuff without
mixing together initialization vs definedness, globals vs lexicals, flow
control analysis vs counting occurrences, compile time vs run time, and
definite problems vs possible problems. Makes my head hurt.

Reply via email to