If you're using gcc, you can compile with "-Wshadow" to get a warning for this type of problem.
Speaking of variable shadowing: It's usually worth wrapping any preprocessor macros in a "do { ... } while (0)" block unless you deliberately want variable definitions to escape (in which case, token pasting a suffix is usually a good idea).
I sometimes use "{ ... }" to limit the scope of a variable that is only needed for a small section of code.
MACRO(foo);