Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VAX vs. Compiler Question

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
pwaugh Posted - Feb 06 2007 : 2:12:01 PM
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.
11   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 09 2007 : 07:45:22 AM
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?
pwaugh Posted - Feb 08 2007 : 2:51:54 PM
Ah, I get what you mean now.

This way the condition being off doesn't hide stuff I may want it to know about.
feline Posted - Feb 08 2007 : 09:27:18 AM
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.
pwaugh Posted - Feb 07 2007 : 1:34:53 PM
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.
feline Posted - Feb 07 2007 : 1:19:00 PM
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.
pwaugh Posted - Feb 07 2007 : 09:21:37 AM
Yeap... new feature: UNIX sensing ON/OFF. =)
feline Posted - Feb 07 2007 : 08:52:53 AM
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
pwaugh Posted - Feb 06 2007 : 7:30:10 PM
VS2005.
feline Posted - Feb 06 2007 : 7:06:35 PM
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
pwaugh Posted - Feb 06 2007 : 4:16:43 PM
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.
support Posted - Feb 06 2007 : 3:13:10 PM
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.

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