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
 VAX suggests fields within a named union
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Paul
New Member

USA
9 Posts

Posted - Apr 06 2007 :  7:43:48 PM  Show Profile  Reply with Quote
I have C application with a structure that has a named union, i.e.,


typedef struct t_GTD
{
    union {
        struct {
             t_V2D       intercept;
        } ellipse;
        struct {
            double  	Q2;
            double  	W2;
         } torus;
        struct {
            double  	c0;
            double  	c1;
            double  	c2;
            double  	c3;
        } lor;
    } u; 
}  t_GTD;

When I reference this structure, VAX correctly suggests u and incorrectly suggests ellipse, torus and lor. Since they're presented alphabetically (and I forget about the u), I select the inner field (e.g., GTD->ellipse) and then get a bunch of compilation errors.

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Apr 07 2007 :  2:16:06 PM  Show Profile  Reply with Quote
If you move the structure and union names to the beginning, like this, then the problem goes away. Of course, this might work more easily if you were compiling in C++

typedef struct t_GTD
{
	union u {
		struct ellipse {
			t_V2D       intercept;
		} ;
		struct torus {
			double  	Q2;
			double  	W2;
		} ;
		struct lor {
			double  	c0;
			double  	c1;
			double  	c2;
			double  	c3;
		} ;
	} ; 
}  t_GTD;


case=4514

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

support
Whole Tomato Software

5566 Posts

Posted - Mar 17 2011 :  11:42:52 PM  Show Profile  Reply with Quote
case=3548 is a similar issue to case=4514, and is fixed in build 1845

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