Is there any way to give a warning when a nested function use its parent function's local variable value.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Such as this code

void foo(int x)
{
    int a;
    void foo2(int i)
    {
        // I want warning for the below code.
        if (i == a){}
        x += i;
        a += i;
    }
    foo2(a);
}

Because I use nested function for better code orgnization and callback. Thanks.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux