[omniORB] Differences on RH and DEC

Bruce Visscher visschb@rjrt.com
Thu, 19 Apr 2001 13:24:17 -0400


Matthew,

What version of cxx are you using on OSF?  This sounds like a known
problem with the optimizer that comes with version 6.2 of Compaq C++.

Here is a reproducer:

------------------------------- TEST.CXX -------------------------------
#define __USE_STD_IOSTREAM
#include <iostream>

struct COMM_FAILURE{};

struct X {
  X() {
    flags.forward_location=0;
    flags.x1=0;
    flags.x2=0;
  }
  struct {
    unsigned forward_location : 1;
    unsigned x1 : 1;
    unsigned x2 : 1;
  } flags;

  void f() {
    int fwd;
    while (true) {
      try {
        fwd=flags.forward_location;
        doSomeWork();
      }
      catch (COMM_FAILURE& e) {
        if (fwd) {
          processLocationForward();
        } else {
          throw;
        }
      }
    }
  }
  void doSomeWork() {
    throw COMM_FAILURE();
  }

  void processLocationForward() {
    std::cout << "Here we go again!" << std::endl;
  }

};

int main() {
  X x;
  try {
    x.f();
  }
  catch (COMM_FAILURE) {
    std::cout << "Did the right thing!" << std::endl;
  }
}
------------------------------- TEST.CXX -------------------------------

If you compile and run this, it should say "Did the right thing!".  If
it says "Here we go again!" over and over, you need a newer compiler. 
According to Compaq, version 6.3 fixes this bug on all platforms.  I
believe version 6.3 is the current release on Tru64.  It is in Beta on
OpenVMS.  It appears to be fixed on OpenVMS using the Beta compiler.

HTH,

Bruce
-- 

Bruce Visscher                                        visschb@rjrt.com
CONFIDENTIALITY NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information.  If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system.  Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.