IBM Support

With variable named "override" RTConfig renders incorrect code

Troubleshooting


Problem

In IBM® DevOps Model RealTime® (Model RT), if you have a variable called override, the RTConfig does not handle the code correctly.

Symptom

The override variable disappears, if you have the following sample code:
#if __cplusplus < 201103L && _MSC_VER <= 1500
#include <cstddef>
#define nullptr NULL
#define override /*override*/
#define RTUseCPP11 0
#else
#define RTUseCPP11 1
#endif

Cause

Unknown

Resolving The Problem

Add the following to the transformation configuration's Code Generation > Common preface:
#if !RTUseCPP11
#undef override
#undef nullptr
#endif
This code is generated into the unit header file, which is included with all generated code.  It prevents RTConfig.h from affecting the macro definitions in the code.
If there are manually written .cpp files that include RTConfig.h, the same code should be added to those files.  Otherwise, it should be verified that they include the unit header file.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSSID6C","label":"IBM DevOps Model RealTime"},"ARM Category":[{"code":"a8m0z000000bmhRAAQ","label":"Rational Software Architect Realtime Edition-\u003EUML RealTime Modeling"}],"ARM Case Number":"TS016159138","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.0.0"}]

Product Synonym

Model RT

Document Information

Modified date:
29 August 2024

UID

ibm17166847