Mostly, it's just a bad idea - it's very easy for a person reading the code after you've written it to get the two x's mixed up.

// example from: 19.17.1.3
void main()
{
    { static int x; }
    { static int x; } // error
    { int i; }
    { int i; } // ok
}

I don't really see how the 'static' storage class would make 2 variables with the same name in different scopes "easier to mix up" compared to 2 variables with the same name in different scopes but declared without the 'static' keyword.

Reply via email to