Author |
Topic  |
|
jzq740176597
Tomato Guru
    
China
346 Posts |
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? |
Creation come from persist! |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
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? |
zen is the art of being at one with the two'ness |
 |
|
jzq740176597
Tomato Guru
    
China
346 Posts |
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? |
Creation come from persist! |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
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  |
zen is the art of being at one with the two'ness |
 |
|
|
Topic  |
|