Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2646
Collapse the table of content
Expand the table of content

Compiler Error C2646

Error Message

global anonymous unions must be declared static

An anonymous union has global scope but is not declared static.

The following sample generates C2646:

// C2646.cpp
// compile with: /c
union { int i; };   // C2646 not static

// OK
static union { int j; };
union U { int i; };

Community Additions

ADD
Show:
© 2015 Microsoft