This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: about the 'for' statement
- To: "R. Kelley Cook" <KCook at IBM dot net>
- Subject: Re: about the 'for' statement
- From: Per Bothner <per at bothner dot com>
- Date: 16 Aug 1999 11:39:12 -0700
- Cc: "egcs at egcs dot cygnus dot com" <egcs at egcs dot cygnus dot com>
- References: <xpbbxvozarg.fgkkce0.pminews@news3.ibm.net>
"R. Kelley Cook" <KCook@IBM.net> writes:
> > for (i=1;i++;i<10){
> > //some statement here
> > }
> > If this for statement will be translated to something like this :
> >
> > i=1;
> >l1:
> > if (i<10){
> > //some statements here
> > i++;
> > goto l1;
> > }
> >
>
> yes
Wrong. Try:
i=1;
l1:
if (i++){
//some statements here
i<10; // no-op.
goto l1;
}
I.e. the i++ and i<10 are probably switched ...
--
--Per Bothner
bothner@pacbell.net per@bothner.com http://home.pacbell.net/bothner/