[cfe-dev] Variable out of scope

Anders Rönnholm Anders.Ronnholm at evidente.se
Tue Apr 15 05:29:49 PDT 2014


Hi,

How do i see that a variable is out of scope in a checker? Like in the example below i'd like to see that p is dead when assigning 0 to it as x is out of scope.

void f() {
    int *p;
    {
        int x;
        p = &x;
    }
    *p = 0;  // <-- error! p is dead.
}

//Anders



More information about the cfe-dev mailing list