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
 Incorrect handling of anonymous member struct
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BruteForce
Senior Member

Greece
32 Posts

Posted - Nov 09 2006 :  11:11:57 AM  Show Profile  Reply with Quote
Hi,

It seems that VA does not handle correctly anonymous struct or union members. The sample C code given at the end of this topic compiles OK with the C compiler of VS2005 but VA (a) underlines with a red line the last 3 assignment statements and (b) does not present the Bytes/bytes01/bytes23 names as options in Intellisense when I type "p."; it only presents "StructType".

Regards,
Dimitris Staikos

====== SAMPLE CODE STARTS HERE ======

typedef union
{
struct { char Bytes[4]; };
struct { unsigned short bytes01; unsigned short bytes23; };
} CONTENT;

typedef struct _STRUCTDATA
{
int StructType;
CONTENT;
}
STRUCTDATA, *PSTRUCTDATA;

int main(int argc, char* argv[])
{
STRUCTDATA p;
p.StructType = 0;
p.Bytes[0] = 0;
p.bytes01 = 0;
p.bytes23 = 0;
return 0;
}


When all else fails try common sense.

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Nov 09 2006 :  1:29:32 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=904

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