Re: [PATCH] remove inline iteration variable
David Rientjes, Wed, Aug 16, 2006 19:14:44 +0200:
Show 10 quoted lines
> > > Remove unnecessary iteration variable in inline.
> > > - for (i = 0; i < in; i++) putchar(' ');
> > > + for (; in > 0; in--)
> >
> > while(in--) putchar(' ');
> >
>
> That goes into an infinite loop if the argument is negative because
> it emits a cmpl $0, x(%ebp). Should never happen, but there's no
> reason not to prevent it with a for loop.while (in-- > 0) putchar(' ');still shorter :)