Re: [patch] Bug #459

Aaron Lehmann (aaronl@vitelus.com)
Fri, 18 Jun 1999 17:17:51 +0000 ( )


I took the sample code right out of the description for bug 459. If it is
incorrect, you should update the bug's descripiton.

On Fri, 18 Jun 1999, Shaw Terwilliger wrote:

> Aaron Lehmann wrote:
> >
> > I summerized the description of the metrowerks problem and added it to the
> > programmer guidelines. here's the patch:
>
> Again, I don't claim to be the ANSI C++ expert, but the patch says:
>
> For example, this is perfectly legal C++:
>
> for (int i=0; i > 10; i++) {
> printf("i is %d \n", i);
> }
> printf("I is now %d \n", i);
>
> ... but I really don't think it is. :) The ANSI C++ drafts I could
> find (I should buy the ANSI/ISO standard to stick on my bookshelf)
> say i should not be visible outside the loop. In short, if you want
> to use it, declare it before the for(). By this it seems MetroWorks
> C++ is very ANSI/ISO compliant. EGCS also tells you not to do this:
>
> thing.c: In function `int main()':
> thing.c:8: warning: name lookup of `i' changed for new ANSI `for'
> scoping
> thing.c:5: warning: using obsolete binding at `i'
>
> --
> Shaw Terwilliger
>



This archive was generated by hypermail 1.03b2.