Friday, January 9, 2009

Scope of macros

Macros have file scope by nature.
However, macro encapsulating code fragments as
#undef m
#define m ...
...code...
#undef m
have been seen. They allow to hide macros from the rest of the source file. However, the general problems with macro names remain.
Limiting macro scope is a bit obscure.

0 Comments: