lkml.org 
[lkml]   [1998]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [FIXES] 2.1.125
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/

\
 
 \ /
  Last update: 2005-03-22 13:44    [from the cache]
©2003-2011 Jasper Spaans