Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 wrong macro parsing and expansion
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

g0dpEUmE
Junior Member

24 Posts

Posted - Apr 14 2026 :  02:53:04 AM  Show Profile  Reply with Quote
Windows 10, va 2610


VA occationally fail to provide macro definition, and expands in a wrong way, like the left one in first image and the second image.
And about the right one in the first image, it seems to be a long-existing problem in va's parsing engine. It provides unrelated information, and the info shows on completion or hovering tooltip. Rebuilding the symbol database and clearing cache don't help.

feline
Whole Tomato Software

United Kingdom
19360 Posts

Posted - Apr 14 2026 :  10:22:39 AM  Show Profile  Reply with Quote
Macro expanding is "hard" without getting to compile the code, since sometimes, thankfully rarely, the same macro gets expanded differently in different files in the same solution. This isn't something VA can easily handle, since we don't get to re-write your code files to properly expand the macros. The pre-processor gets to do this, but if we did that, you would no longer be editing the code you are actually working on.

For the "EXTERN_C" macro, is the definition in the same file as where you are doing the mouse hover? Or is it defined in one file, and expanded in another file?

Where / how is "__cplusplus" defined? I can then try to set up a reasonable test case here for it.


LoadLibraryW(), what happens if you use Alt-G on this? For me, doing a quick and simple test, I am offered two different locations. One is a function declaration, one is a macro. Only the macro can be expanded as a macro, obviously. But when the same symbol exists with two different definitions, in standard header files that VA automatically parses, we are going to run into problems like this.


WINUSERAPI I am seeing an expansion for. Which version of Visual Studio are you working in?

zen is the art of being at one with the two'ness
Go to Top of Page

g0dpEUmE
Junior Member

24 Posts

Posted - Apr 14 2026 :  11:17:38 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Macro expanding is "hard" without getting to compile the code, since sometimes, thankfully rarely, the same macro gets expanded differently in different files in the same solution. This isn't something VA can easily handle, since we don't get to re-write your code files to properly expand the macros. The pre-processor gets to do this, but if we did that, you would no longer be editing the code you are actually working on.

For the "EXTERN_C" macro, is the definition in the same file as where you are doing the mouse hover? Or is it defined in one file, and expanded in another file?

Where / how is "__cplusplus" defined? I can then try to set up a reasonable test case here for it.


LoadLibraryW(), what happens if you use Alt-G on this? For me, doing a quick and simple test, I am offered two different locations. One is a function declaration, one is a macro. Only the macro can be expanded as a macro, obviously. But when the same symbol exists with two different definitions, in standard header files that VA automatically parses, we are going to run into problems like this.


WINUSERAPI I am seeing an expansion for. Which version of Visual Studio are you working in?



I'm using VS2010.
These are not my customized macros. The EXTERN_C is defined in winnt.h. However even if I define the same one in current file this also happens. __cplusplus should be a common compiler macro as far as I know, F12 fails to find its definition, and I haven't defined it as well.
Alt-G also give two definitions to go. The confusion of VA by multiple definitions also cause problem to tooltip, so I have to navigate between them, and in previous post in Technical Support forum this can get the tooltip to disappear.
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000