Compiler Error C2646
an anonymous struct or union at global or namespace scope must be declared static
An anonymous struct or union has global or namespace scope but is not declared static
.
The following sample generates C2646 and shows how to fix it:
// C2646.cpp
// compile with: /c
union { int i; }; // C2646 not static
// OK
static union { int j; };
union U { int i; };
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for