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
 Find references fails in a designated initializer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mvolkar
Junior Member

14 Posts

Posted - Aug 27 2018 :  4:19:17 PM  Show Profile  Reply with Quote
C99 allows you to initialize individual fields of a structure using a designated initializer list as follows (example stolen from another forum post):

struct Person
{
	int height;
	int weight;
	int age;
};

int main()
{
	struct Person p = { .age = 18 };
}


What I have found is that if I select one of the identifiers in the initializer list (e.g., age in this case) and try to use the Find References feature of Visual Assist, it tells me that the symbol is unrecognized. The interesting part of this is that Goto Implementation is able to find the field in the struct definition, and Find References works from there. This seems to indicate to me that Visual Assist knows something about the identifier, but isn't properly handling it for Find References. This is obviously a minor annoyance, but I still wanted to report it. I am using Visual Assist build 2283.1 and Visual Studio 2015.

feline
Whole Tomato Software

United Kingdom
16289 Posts

Posted - Aug 28 2018 :  07:04:01 AM  Show Profile  Reply with Quote
I am seeing the same effect here, thank you for the clear description:

case=118748

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

sean
Whole Tomato Software

USA
2758 Posts

Posted - Dec 20 2019 :  2:27:21 PM  Show Profile  Reply with Quote
case=118748 is implemented in build 2358.
https://support.wholetomato.com/default.asp?W404
http://builds.wholetomato.com/binaries/VA_X_Setup2358_0.exe
Go to Top of Page

mvolkar
Junior Member

14 Posts

Posted - Dec 20 2019 :  3:16:15 PM  Show Profile  Reply with Quote
Thank you for the update, I downloaded the new build and can confirm that it solves this problem in the case I originally reported. I did note, however, that there was a case in our code that still didn't seem to work correctly. Looking closer, this case is initializing an array of structs using the designated initializer method.

So to expand my previous example, the following code exhibits the same problem behavior:
struct Person
{
	int height;
	int weight;
	int age;
};

int main()
{
	struct Person p[3] =
	{
		{ .age = 18 },
		{ .age = 37 },
		{ .age = 5 }
	};
}
Go to Top of Page

sean
Whole Tomato Software

USA
2758 Posts

Posted - Dec 20 2019 :  3:36:56 PM  Show Profile  Reply with Quote
Sorry about that but thanks for the update. I've opened case=141667 to have it looked into.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000