IBM Support

How do I turn off initialization of pointers to NULL in constructor?

Question & Answer


Question

How do I turn off initialization of pointers to NULL in constructor?

Answer

I need to be able to turn off the generation of the code that initializes pointers to NULL in the constructor, for example:
 
Library::Library(const Book& aBook) : myBook(&aBook){
myBook = NULL;
//#[ operation Library(Book)
//#]
}
 
The code I do NOT want to generate is "myBook = NULL"
 
Solution:
Uncheck the property CG::Relation::SafeInitScalar for myBook and regenerate code.
1417AnswerProduct versionPartner ContentInternal ContentCategoryReference IDAuthor

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

10380

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21323679