What's wrong with this picture in MFC VC++ 6.0?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Zilla (zilla62XSPAM_at_bellsouth.net)
Date: 02/11/04


Date: Wed, 11 Feb 2004 11:11:48 -0500

I have the following union

typedef union {
        struct stJunk {
                unsigned char var1 : 1;
                unsigned char var2 : 1;
                unsigned char fill : 6;
        }stJunk;
        unsigned char uJunk;
} Junk;

Junk junk; // declare junk union variable

I can do
        junk.stJunk.var1 = 0;
        junk.stJunk.var2 = 1;

but not
        junk.uJunk = 0x2; // <--- Compile C2143 and C2059 errors.

Why?

This works in GNU!

-Zilla