Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Rename bug

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
NeoEGM Posted - Mar 13 2008 : 11:20:25 PM
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...
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 15 2008 : 10:10:03 AM
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.
NeoEGM Posted - Mar 14 2008 : 11:58:45 AM
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!
feline Posted - Mar 14 2008 : 10:29:57 AM
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

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