I'm trying to port some C++ code from MS Visual Studio 6.0 to a version of
Code Composer Studio for an embedded application.
This code compiles under Visual Studio, and lets the program reference x, y,
and z. Under a Code Composer Studio compiler, the compiler warns: "this
declaration doesn't declare anything", then gives errors for all subsequent
references to x, y, and z.
union{
struct{
float x, y, z; // Named element representation
};
float v[3]; // Vector component
};
My C++ book implies that the struct declaration shouldn't declare any data
because there is no assigned name, and I believe that is why Code Composer
is complaining.
Is this some legal C++ extension that is just not supported by Code
Composer, or is it a non-standard Visual Studio extension?
Ed.