IBM Support

PI45837: GENERATED PORT ACCESSOR FUNCTION HAS TEMPORARY VARIABLE THAT LACKS 'CONST' QUALIFIER

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

APAR status

  • Closed as program error.

Error description

  • This is a defect with its ability to parse the "const" modifier
    info from the return type when you have disabled the "use
    existing type" option and manually "hard-coded" the type w/
    modifier. Please submit a defect for this.
    
    Normally a workaround would be to model the std::set template
    (as external) and then use that existing type in the model for
    the operation return type and select the const modifier.
    Rhapsody will then generate the correct code. However, this
    doesn't work trying to model std::set<int> due to limitations
    with the way that template instantiations/specializations are
    modeled in Rhapsody.
    
    
    
    Client's model was generating and building correctly in 8.0.4.
    
    Rhapsody's auto-generated port accessor code is stripping
    'const'
    qualifiers from the temporary variable, resulting in a compile
    failure.
    This started happening in 8.1.1. (8.0.4 worked correctly; 8.0.5
    and 8.1
    were not tested.)
    
    Test case has three classes:
    - IStdSetGetter: Interface with a single function that returns
    const
    std::set<int>*.
    - StdSetGetter: Implementation of IStdSetGetter that returns a
    pointer
    to an empty std::set<int>.
    - StdSetGetterNode: Class that has an StdSetGetter part and a
    port that
    provides the IStdSetGetter interface (pfkMgr).
    
    StdSetGetterNode's generated getStdSet() function looks liket
    his:
    
    const std::set<int>* StdSetGetterNode::pfkMgr_C::getStdSet() {
        std::set<int>* res = NULL;
        if (itsIStdSetGetter != NULL) {
            res = itsIStdSetGetter->getStdSet();
        }
        return res;
    }
    
    The internal variable 'res' should have a const qualifier, but
    it's
    missing, resulting in a compiler error due to implicit casting
    of a
    const pointer to non-const.
    
    
    
    When the 806 precompatibility profile was applied to the model
    in 8.1.1, the "const" was added back into the code.
    
    However, this does not work in 8.1.3 and the "const" is not
    added to the line
        std::set<int>* res = NULL;
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Rhapsody 8.1.3                                               *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * GENERATED PORT ACCESSOR FUNCTION HAS TEMPORARY VARIABLE THAT *
    * LACKS 'CONST' QUALIFIER                                      *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    

Problem conclusion

  • Fixed in 8.1.4
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI45837

  • Reported component name

    TLOGIC RHAPSODY

  • Reported component ID

    5724V74RP

  • Reported release

    813

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-07-28

  • Closed date

    2015-12-16

  • Last modified date

    2015-12-16

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    TLOGIC RHAPSODY

  • Fixed component ID

    5724V74RP

Applicable component levels

  • R813 PSY

       UP



Document information

More support for: Rational Rhapsody

Software version: 8.1.3

Reference #: PI45837

Modified date: 16 December 2015