[lkml]   [1998]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    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
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:44    [W:0.019 / U:5.328 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site