T O P I C R E V I E W |
jzq740176597 |
Posted - Nov 02 2012 : 12:48:58 AM

VA versoin_1916 As metioned above, in a cpp file ,in a function,I use FindSymbol function,Even I type all the macro name. It still cann't give me the Symbol. Is bug? |
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Nov 05 2012 : 12:33:55 PM The pre-processor expands the macro, and as far as I know the pre-processor is not scope aware, so it makes sense that the macro is used outside of the function it is declared in.
However this is not the way normal scope rules work. A good example of why dealing with macros can sometimes be a little bit tricky for VA  |
jzq740176597 |
Posted - Nov 04 2012 : 12:43:47 AM Got it,By the way, I Found the macro is within a function is not really local to the function,it also can be used under the file.It's the C++ specification design? |
feline |
Posted - Nov 02 2012 : 3:24:03 PM This is by design, since the macro is within a function. If we expose every symbol that is local to a function then we are going to get swamped by these local symbols.
Since you are only using the macro inside the function, why not simply replace it with a const int? |
|
|