Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1632: Confusions inside equally named functions

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
.oisyn Posted - Apr 11 2008 : 07:03:44 AM
This is a very annoying bug that's new since 1632 and makes VA X pretty much unusable for my current project.

Situation:

main.h:
struct AData
{
    int foo, bar;
};

struct BData
{
    int baz;
};


File1.cpp:
#include "main.h"

void Test()
{
    AData data;
    data.foo = 120;
}


File2.cpp:
#include "main.h"

void Test()
{
    BData data;
    data.baz = 34;
}


And now the annoying part:


Yes, because the function in File2.cpp is named equally as the function in File1.cpp, it thinks that 'data' is the same variable as in File1.cpp, and therefore of the type 'AData' instead of 'BData'. The navigation bar does it correctly, however.

Also, this only works for equally named functions in seperate files. If you put them in the same file, it works as expected.

This is a showstopper for me because I'm working on the PS3, and every SPU job is essentially it's own program with it's own main() function. And since I use similar variablenames for similar jobs, this is confusing the hell out of VA X.

I think I'm going back to 1626 until this is resolved (granted, it's a bit of my own fault as well as I shouldn't use the beta for production work ).
9   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jul 14 2008 : 2:32:44 PM
case=15921 is fixed in build 1645
.oisyn Posted - Apr 14 2008 : 11:15:10 AM
Hmm, I haven't actually tested 1626, but since I only saw the issue after installing 1632 I assumed it was working properly in 1626. Perhaps that assumption was incorrect because as you say typing sometimes fixes it.
sean Posted - Apr 11 2008 : 7:09:55 PM
This happens in 1626 too. Are you using the same test in both 1632 and 1626?
sean Posted - Apr 11 2008 : 12:39:29 PM
case=15921
sean Posted - Apr 11 2008 : 12:35:58 PM
Ok. I'm seeing the problem. It happens if I go into the files and press ctrl+space after the dot operators. But it does not happen if I type "data." - VA is getting out of sync when switching between files and typing fixes it for me. When you experienced the problem were you typing in the different files or immediately doing ctrl+space after arriving in the files?

Edit: typing does not always fix it...
.oisyn Posted - Apr 11 2008 : 11:46:52 AM
If I make the functions static, I no longer get the issue.
.oisyn Posted - Apr 11 2008 : 11:41:40 AM
No, I created this exact same solution in order to found out what was going on in our much much larger project :). Aren't you seeing it the other way around as well? I mean the BData datamembers in File1.cpp?

I have zipped the solution for you guys: http://oisyn.nl/vax_bug.zip

.edit: I'm using 2005 as well. And yes, of course it doesn't compile, you'll get link errors :). But in my actual real-world project, a binary is created for each sourcefile by a custom build step, so linker problems aren't an issue.
feline Posted - Apr 11 2008 : 11:41:11 AM
So far I cannot reproduce this problem. Can you please have a look at this test project, which uses your code, and see if it looks "right":

http://forum.wholetomato.com/colin/forumimages/7437_dup_functions.zip

Note I had to make the functions static to make this compile. This is a VS2005 project, I am not sure which IDE you are using.
sean Posted - Apr 11 2008 : 11:30:59 AM
Is there any chance you've over-simplified the test case? I'm not able to reproduce this.

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