Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VAX suggests fields within a named union

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
Paul Posted - Apr 06 2007 : 7:43:48 PM
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.
2   L A T E S T    R E P L I E S    (Newest First)
support Posted - Mar 17 2011 : 11:42:52 PM
case=3548 is a similar issue to case=4514, and is fixed in build 1845
feline Posted - Apr 07 2007 : 2:16:06 PM
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

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