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
 Technical Support
 VAX vs. Compiler Question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 06 2007 :  2:12:01 PM  Show Profile  Reply with Quote
Given:

Object "InstLights" with a public enum containing OFF=0 and the following cpp code:

FLOAT64 FSAPI XmsnInstLt_cb(PELEMENT_ICON pelement)
{
if(isMainBusPowerOn)
{
SHOW_IMAGE(pelement);
return InstLights::GetRheoStat();
}
HIDE_IMAGE(pelement);
return InstLights::OFF;
}

and an error in that I had not deleted this:

#define OFF 0

from the .h file, VA X will "see" the correct definition given the scope resolution, while when I attempt to compile, the preprocesor will make the substitution and I'll get:

return InstLights::0;

which generates 2 appropriate errors.

Interestingly, when I right clicked and told VA X to take me to the definition, it took me to the error in the .h file and I was able to immediately correct it.

Shouldn't VA X have shown me the preprocessor definition to begin with (since it supercedes the intended one) so I would see the error right away? Just curious what you think. Pretty amazing that it is in a way smarter than the compiler, haha.

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32

support
Whole Tomato Software

5566 Posts

Posted - Feb 06 2007 :  3:13:10 PM  Show Profile  Reply with Quote
What IDE?

It's likely you imply a hovering tooltip when you say, "shown me the preprocessor definition." If so, odds are good the tooltip comes from the IDE and not VA X.

If you only Right+Clicked to go to the definition, i.e. not a Shift+Right Click or Alt+G, you likely used functionality built into the IDE to find the definition.
Go to Top of Page

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 06 2007 :  4:16:43 PM  Show Profile  Reply with Quote
IDE: VS

The tooltip (from intellisense) shows the object def, while the VA X info in the bar above the code editor (VS's is off), showed it also.

The right+click take me to def took me to the .h file. Didn't know about shift+irght click or Alt+G, and since I read Alt+G has bugs, never bothered to try it.

Back to work.

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 06 2007 :  7:06:35 PM  Show Profile  Reply with Quote
Unfortunately VS does not help much, since this could be VS2002, VS2003, or VS2005

While alt-g goes have a couple of bugs, you are quite unlikely to run into them. It is well worth trying, you may find you like it

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

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 06 2007 :  7:30:10 PM  Show Profile  Reply with Quote
VS2005.

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 07 2007 :  08:52:53 AM  Show Profile  Reply with Quote
I have added this code, plus a fake enum and the #define line to a cpp file, using VS2005 and VA 1544
For me alt-g on "OFF" takes me to the enum line, while right click -> go to definition (using the IDE) takes me to the #define line.

The problem with VA realising that the #define takes priority is the code:

#ifdef MONDAY_CODE
#define OFF 0
#else
#define ON 0
#endif


Here VS2005's intellisense parser checks all of the preprocessor definitions, and works out which code is active and which code is not. In contrast VA parses all of this, and see's both macro's. This is so that VA can offer you help on code that is currently disabled, e.g. code that is UNIX specific.

At times like this sometimes the IDE gives "better" results, and sometimes VA gives "better" results, so it can be useful to try both of them and see what happens. It is simply because they are designed to do slightly different jobs. Hopefully all of this makes sense

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

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 07 2007 :  09:21:37 AM  Show Profile  Reply with Quote
Yeap... new feature: UNIX sensing ON/OFF. =)

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 07 2007 :  1:19:00 PM  Show Profile  Reply with Quote
Already done, VA is line ending aware, and we do have users editing in the IDE, with the help of VA, while compiling under UNIX / Linux. I have done this myself, jumping between the IDE and the UNIX command prompt

As for UNIX sensing, what about the more common:

#ifdef DEBUG
// I want help here!
#else
// and here!
#endif

or blocks that are compiler or OS dependent? This is why VA tries to help everywhere, rather than just in your current configuration. Plus we don't automatically have access to the current configuration even if we wanted to be more clever.

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

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 07 2007 :  1:34:53 PM  Show Profile  Reply with Quote
You missed the point of my post.

If VA X is giving me "mis-information" (in my eyes) due to being UNIX aware, and I am programming in Windows (and hence don't care about UNIX a bit), then it would be nice if I could turn that off.

Yeap, it is cool that it's UNIX aware, and more power to you, just useless to me, and hence the usefulness of the option to those like me.

But, I'm not going to lose sleep over it.

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 08 2007 :  09:27:18 AM  Show Profile  Reply with Quote
UNIX aware is a poor choice of name for this effect. I was simply trying to illustrate one example of why VA works the way it does.

You can equally well have conditional code under other circumstances.

In this particular case VA is not working in an ideal manor, but hopefully these sort of situations are quite rare.

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

pwaugh
Ketchup Master

USA
68 Posts

Posted - Feb 08 2007 :  2:51:54 PM  Show Profile  Reply with Quote
Ah, I get what you mean now.

This way the condition being off doesn't hide stuff I may want it to know about.

Programming in C++

VA_X.dll 10.4.1626.0
Built 2008.01.17

(1-user license) Support ends 2009.01.29

DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor
Platform: Win32
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 09 2007 :  07:45:22 AM  Show Profile  Reply with Quote
Imagine the complaints if VA stopped helping you in a block of code that is only active during release mode, just because you were currently compiling in debug mode?

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic 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