Hi all --
To Milan: Yes, the exception is thrown on any architecture. So, the same code
with the same exceptions runs fine on SPARC 32/64 bit and x86 -- it only fails
on x64.
To Martin: We're using SunStudio 12 to compile the code. We currently don't
have a version compiled with gcc.
To John: I'm sorry, I was a little wrong here and have to correct the
re-throwing statement. Our developer just corrected me that the exception is
not thrown in a sub-method as I assumed, but in a macro that I've missed...
Therefore it is thrown just once.
The code in lib B has a makro like this:
#define CHECK_RES(result, name, namelen) \
if (result != 0) { \
MyChar* nameformatted = GetHexString((MyChar*)name, namelen); \
MyException e(ERR_OPERATION_FAILED, \
nameformatted); \
e.setErrorId(result); \
delete [] nameformatted; \
throw e; \
}
... and the method which is using this makro to throw the exception is:
void B::b1() {
...
if (local) {
...
result = ...;
CHECK_RES(result, name, namelen); // exception thrown here is not being
caught on x64!
}
...
}
... and the two exception classes MyException and the base class
MyBaseException:
class MyException: public MyBaseException
{
public:
MyException(void) throw() : MyBaseException()
{}
MyException(const MyChar* msg, ...) throw();
MyException(MyInt64 errorId, const MyChar* msg) throw();
/** Copying instance allowed */
MyException(const MyException& rhs) throw();
/** destructor */
virtual ~MyException(void) throw();
};
class MyBaseException
{
public:
MyBaseException(void) throw();
MyBaseException(const MyChar* msg, ...) throw()
/** Copying instance allowed */
MyBaseException(const MyBaseException& rhs) throw();
/** Assigning instance not allowed */
MyBaseException& operator=(const MyBaseException& rhs) throw();
virtual ~MyBaseException(void) throw();
};
Thanks for your help,
Nick.
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]