...
DCL01-C-EX2: A temporary variable within a new scope inside of a macro can override a surrounding identifieroverride an identifier in a containing scope. This does not apply to to the arguments of the macro itself.
Code Block | ||||
---|---|---|---|---|
| ||||
#define SWAP(type, a, b) do { type tmp = a; a = b; b = tmp; } while(0) void func(void) { int tmp = 100; int a = 10, b = 20; SWAP(int, a, b); /* Hidden redeclaration of tmp is acceptable */ } |
...