Community
Participate
Working Groups
Created attachment 272692 [details] Sample model When an attribute in a (passive) class is marked as static, or when it has the AttributeProperties stereotype with kind=="Global" or kind=="Define", or AttributeProperties.type is not null, then the generated code has incorrect type descriptors and compilation will fail. See the attached model. In the sample model there is a class Class1 with five attributes a1, a2, a3, a4 and a5. a1 is a normal attribute. a2 is static. a3 has kind=="Global". a4 has kind=="Define" and a5 has a non-null type in the stereotype. The generated code in Class1.cc is [code] float Class1::a2; const UMLRTObject_field Class1::fields[] = { { "a1", &UMLRTType_float, offsetof( Class1, a1 ), 1, 0 }, { "a3", &UMLRTType_float, offsetof( Class1, a3 ), 1, 0 }, { "a4", &UMLRTType_float, offsetof( Class1, a4 ), 1, 0 } }; float a3; [/code] A descriptor for a2 is missing from fields. The declaration of a3 is done after fields and it is global so the offset expression cannot be resolved. a4 is not declared anywhere, and no descriptor is generated for a5. All these will cause compilation errors.