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
 Rename bug
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

NeoEGM
New Member

4 Posts

Posted - Mar 13 2008 :  11:20:25 PM  Show Profile  Reply with Quote
I've found a rename bug... Let's say you have the following C++ code...


for (int i = 0; i < 10; i++)
{
	int b = i;

	for (int i = 0; i < 10; i++)
	{
		int c = i;
	}

	int d = i;
}

for (int i = 0; i < 10; i++)
{
	int b = i;

	for (int i = 0; i < 10; i++)
	{
		int c = i;
	}

	int d = i;
}


If you try to rename the bold red i, it will rename all the red i... Renaming the three of the other for loop, which isn't in their scope...

Also, if you try to rename the bold limegreen i, it will rename all the limegreen i... Renaming the ones out of the for loop scope too (but inside the parent for loop)...

Try it and take a look...

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 14 2008 :  10:29:57 AM  Show Profile  Reply with Quote
From memory there is a compiler specific effect here at the code level. By default older versions of Visual Studio work differently to newer versions.

I think that in VC6 and VS2003 the variable is in scope after the end of the for loop, but in VS2005 the variables scope ends at the end of the for loop. I have not double checked that though.

Rename being confused by duplicate variable names with overlapping scope, this should be covered by:

case=1767

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

NeoEGM
New Member

4 Posts

Posted - Mar 14 2008 :  11:58:45 AM  Show Profile  Reply with Quote
Yes, that's right, in VS2005 the scope of the for variables is limited to the for itself by default to be complaint with the ISO Standard... I'm using VS2005 with that option enabled, so what I pointed shouldn't be happening... Thanks!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 15 2008 :  10:10:03 AM  Show Profile  Reply with Quote
Yes, but VA's parser is independent of the IDE / compiler that you are using. Some people use the IDE to edit their code, but use a different compiler. I have edited code in the IDE before now, while compiling it under UNIX.

Most users simply use the IDE's compiler, but the compilers behaviour can be modified by the various flags you pass to it, flags that can change between release and debug mode.

Because of this I really want to avoid VA trying to get into compiler specific parsing.

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