You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply omitting the class-name portion of the syntax does not make a union an anonymous union. For a union to qualify as an anonymous union, the declaration must not declare an object.
I think we are getting into trouble because we are declaring class objects (i.e., objects of type m_halfs). That's what the SunCC compiler is complaining about.
I'm guessing the cod below is very old with a MSVC pedigree. It probably dates back to the late 1990s.
union
{
#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
dword m_whole;
#endif
struct
{
#ifdef IS_LITTLE_ENDIAN
word low;
word high;
#else
word high;
word low;
#endif
} m_halfs;
};
The text was updated successfully, but these errors were encountered:
Testing under Solaris 11.3 is revealing:
According to the Microsoft docs at Anonymous Unions:
I think we are getting into trouble because we are declaring class objects (i.e., objects of type
m_halfs
). That's what the SunCC compiler is complaining about.Also see SunCC 5.12 through 5.14 and “Types cannot be declared in anonymous union”. Its our question for this issue. A related question is Why does C++ disallow anonymous structs and unions? on Stack Overflow, but its not our question.
I'm guessing the cod below is very old with a MSVC pedigree. It probably dates back to the late 1990s.
The text was updated successfully, but these errors were encountered: