Re: [FIXES] 2.1.125

Tim Smith (tzs@tzs.net)
Sun, 11 Oct 1998 17:14:13 -0700 (PDT)


On Sun, 11 Oct 1998, Matthias Andree wrote:
> Virtually every C compiler supports function inlining as a special
> extension, but there are not too many that do support local
> declarations - that have their traps anyways, like in:
>
> for(int i = 0; i < 99; i++)
> for(int j = 0; i < 99; j++) if (i == j) do_nonsense(i,j);
>
> i remains declared, j doesn't.

In the final C++ standard, the scope of i is the for loop. For compilers
that don't implement it that way, you can get that effect by this trick
somewhere above:

#define for if(0);else for

--Tim Smith

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/