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
 1632: Confusions inside equally named functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

.oisyn
Tomato Guru

162 Posts

Posted - Apr 11 2008 :  07:03:44 AM  Show Profile  Reply with Quote
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 ).

Edited by - .oisyn on Apr 11 2008 07:08:23 AM

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 11 2008 :  11:30:59 AM  Show Profile  Reply with Quote
Is there any chance you've over-simplified the test case? I'm not able to reproduce this.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Apr 11 2008 :  11:41:11 AM  Show Profile  Reply with Quote
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.

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

.oisyn
Tomato Guru

162 Posts

Posted - Apr 11 2008 :  11:41:40 AM  Show Profile  Reply with Quote
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.

Edited by - .oisyn on Apr 11 2008 11:45:27 AM
Go to Top of Page

.oisyn
Tomato Guru

162 Posts

Posted - Apr 11 2008 :  11:46:52 AM  Show Profile  Reply with Quote
If I make the functions static, I no longer get the issue.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 11 2008 :  12:35:58 PM  Show Profile  Reply with Quote
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...

Edited by - sean on Apr 11 2008 6:43:43 PM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 11 2008 :  12:39:29 PM  Show Profile  Reply with Quote
case=15921
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Apr 11 2008 :  7:09:55 PM  Show Profile  Reply with Quote
This happens in 1626 too. Are you using the same test in both 1632 and 1626?
Go to Top of Page

.oisyn
Tomato Guru

162 Posts

Posted - Apr 14 2008 :  11:15:10 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jul 14 2008 :  2:32:44 PM  Show Profile  Reply with Quote
case=15921 is fixed in build 1645

Whole Tomato Software, Inc.
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