Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1442: #define and the Goto feature

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
zworg Posted - Mar 17 2006 : 06:07:37 AM
VC++ 6 IDE

// test.c
#include <stdlib.h>

#ifdef SOMETHING
#define malloc(x) somethingelse(x)
#endif

int f()
{
   malloc(10);
}

Note: symbol SOMETHING is *not* defined
Put the caret on 'malloc' from the malloc(10) line.

1) Alt+G shows 3 locations for me:
crtdbg.h
malloc.h
stdlib.h
Why test.c is not listed there (even if I remove #ifdef/#endif)?

2) The Definition field (and the tooltip shown when you type '(' after malloc) shows only one definition
#define malloc(x) somethingelse(x)

However, if I delete the #define malloc line and save the file the Definition field and the tooltip get 'fixed', i.e. they will display 3 alternative definitions from the above 3 locations.

1   L A T E S T    R E P L I E S    (Newest First)
support Posted - Mar 18 2006 : 6:23:29 PM
The presence of #ifdef is immaterial to VA X. Our add-in will parse and "know" all code inside #ifdef and #else clauses, creating many situations in which you have multiple definitions for a symbol. This is by design, and done since you want VA X help when you're editing the #ifdef clauses, and the #else clauses.

That said...

We can reproduce the inconsistency between the Definition field and the Alt+G list. It appears our code which builds the Alt+G list ignores preprocessor macros in certain circumstances (after reopening a workspace in vc 6; after rebuild of a symbol database in vs.net)

If you type:

foo(){
return 0;
}
main(){
foo();
}

... and place your caret on foo within main(), Alt+G takes you to the implementation of foo. If you add a #define to override foo, the same Alt+G takes you to the #define. If you reopen your workspace in vc 6, or rebuild your symbol database in vs.net, the same Alt+G takes you again to the implemention. You expect to go to the #define.

case=1039

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000