IBM Support

PM52247: unexpected behavior of the C++ MISRA rule 2_10_4

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • MISRA_2_10_4 states that 'A class, union or enum name (including
    qualification, if any) shall be a unique identifier. '
    
    When the source code below is checked for violations for MISRA
    C++ rule MISRA_2_10_4, it reports violations on the statement
    where it is not expected.
    
    namespace {
    
      class AutoCounter {    // compliant MISRA-2-10-4 but a
    violation is raised
      public:
    
        AutoCounter (int x) {};
    
      };
    
    }
    
    
    class AutoCounter2 {    // compliant MISRA-2-10-4 (correct
    behavior)
      public:
    
        AutoCounter2 (int x) {};
    
      };
    
    
    int test_MISTA_2_10_4 () {
    
          AutoCounter2 counter2(3);
    
          AutoCounter counter(3);
    
      return 4;
    
    }
    
    
    We also observed that if the class 'AutoCounter' is taken off
    from the namespace no violation is reported.
    Say like:
    
    class AutoCounter {    // compliant MISRA-2-10-4 but a violation
    is raised
      public:
    
        AutoCounter (int x) {};
    
      };
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    MISRA_2_10_4 states that "A class, union or enum name
    (including qualification, if any) shall be a unique
    identifier. "
    

Problem conclusion

  • Fixed in Rational Logiscope release 6.6.3 iFix 4.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM52247

  • Reported component name

    TLOGIC LOGISCOP

  • Reported component ID

    5724V81LS

  • Reported release

    660

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-11-14

  • Closed date

    2011-12-09

  • Last modified date

    2011-12-09

  • 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 LOGISCOP

  • Fixed component ID

    5724V81LS

Applicable component levels

  • R660 PSN

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYQHS","label":"Rational Logiscope"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.6","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
09 December 2011