There is a problem when using macros. Let assume that some macro is defined
#define SomeMacro( memvar1 ) \
{ \
int *memvar2 = NULL; \
... \
memvar2 = memvar1; \
SomeFunction( memvar2 ); \
}
Someone may call the macro specifying as an argument a variable with the
name memvar2. In this case instead of
memvar2 = memvar1; /* from the macro definition */
we will get
memvar2 = memvar2;
It is not what we wanted to get.
At first I decided to use a special prefix for local macro variable names
such as m_. For example m_memvar2. Well, the code works. However one macro
may call another macro and the same problem can arise.
Is any trick in C which allows to escape the problem?
Vladimir Grigoriev