Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Incorrect handling of anonymous member struct

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
BruteForce Posted - Nov 09 2006 : 11:11:57 AM
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;
}

1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 09 2006 : 1:29:32 PM
I am seeing the same effect here. Thank you for the clear description.

case=904

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