On 9/19/05, Russ Cox <[EMAIL PROTECTED]> wrote:
> > 1 void freelist(lnode **list)
> > 2 {
> > 3 lnode *tmp;
> > 4
> > 5 while( *list != nil){
> > 6 tmp = *list;
> > 7 *list = (*list)->next;
> > 8 tmp = freenode(tmp);
> > 9 }
> > *list = nil;
> > }
>
> > The compiler complains about line 8:
> > warning: file.c: set and not used: tmp
>
> And rightly so!
>
Yep, line 8's assignment gets wiped out by line 6's assignment on the
second iteration.
May as well just read.
freenode(tmp); on line 8.
The compiler is good for finding this :)
> Russ
>