[omniORB] Deletect failed allocation to a _var

EXT-Pennington, Dale K dale.k.pennington at boeing.com
Wed Jun 4 13:47:32 BST 2008


I am doing a port of code from one OS/compiler/ORB to a different
OS/compiler/ORB (destination ORB being omniORB).

At one point of the code, they are performing as assert check to make
sure that a new operation succeeded. The code :

CosNaming::Name_var compound_name = new CosNaming::Name(count);
assert(compound_var != 0);

My compiler has issues on the assert, saying it has not != operation.
Looking at the Naming.hh header file I can understand this, as what is
really needed is to check if the internal reference pointer is NULL. How
they got this to work on their other system I do not know. It was either
an ORB specific extension, or a compiler quirk.

So the question. How would I check to confirm that the new worked
successfully.  I guess maybe something with operator ->, but I am not
experienced enough in that part of C++ to see how.

Thanks,
Dale Pennington



More information about the omniORB-list mailing list