There is no way. As Brian said, you need to use different variable names. Some people prepend global variables with g_, as in g_foo to differentiate them from local variables. Another method is to put your global variables in a static structure, so they are accessed globals.foo. Both these methods can make code more readable as it makes it immediately clear that a variable is a global.