IV48141: INCORRECT WARNING FOR UNREACHABLE STATEMENT with throw

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When an exception is thrown, an undeserved message 1540-5340 is
    issued with the below test case.
    
    "xlc12_defect_infounreachable.cpp", line 14.4: 1540-5340 (I)
    The statement is unreachable.
    "xlc12_defect_infounreachable.cpp", line 16.8: 1540-5350 (I)
    The condition always evaluates to false.
    "xlc12_defect_infounreachable.cpp", line 16.15: 1540-5340 (I)
    The statement is unreachable.
    
    For the below example, only the first 1540-5340 is unexpected.
    The second is expected.
    
    ===== TESTCASE:
    $cat xlc12_defect_infounreachable.cpp
    #include <iostream>
    #include <stdexcept>
    #include <cstdlib>
    
    signed main(signed argc, char **) {
       signed result(EXIT_SUCCESS);
    
       if (1 == argc) {
          std::cout << "reachable" << std::endl;
       } else {
          std::string const msg("arg entered");
          std::runtime_error const e(msg);
          throw e;
       } // line 14
    
       if (false) {  //line 16
          std::cout << "unreachable" << std::endl;  //line 17
       }
    
       return result;
    }
    
    xlC -q'info=all' xlc12_defect_infounreachable.cpp
    

Local fix

  • N/A, only warning.
    

Problem summary

  • PROBLEM DESCRIPTION: Incorrect unreachable message was placed
    in compiler generated code, confusing the users.
    
    USERS AFFECTED: Users with -qinfo=rea option on
    

Problem conclusion

  • The message is no longer being emitted incorrectly.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV48141

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-09-11

  • Closed date

    2013-12-13

  • Last modified date

    2013-12-13

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

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

    LI77711

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RC10 PSY U863925

       UP C



Rate this page:

(0 users)Average rating

Document information


More support for:

XL C/C++ for AIX
Compiler

Software version:

12.1

Reference #:

IV48141

Modified date:

2013-12-13

Translate my page

Machine Translation

Content navigation