[xsd-users] Polymorphic problems.

Boris Kolpackov boris at codesynthesis.com
Thu Dec 4 09:28:19 EST 2008


Hi Bill,

Bill Pringlemeir <bpringle at sympatico.ca> writes:

> I have used a make rule to do the same thing (I think).  It boils down
> to the sed script,
> 
> [...]
> 
> Is that the correct fix to remove the '_base' from the
> type_factory_initializer?

I think that should do it.


> However, I still have issues with AIX; AIX throws the no_type_info
> exception. I was using CXX=xlC_r CXXFLAGS=-qrtti=all for the XL C++
> options.  Do you have this problem with XL C++ as well?

Yes, I could reproduce it with XL C++ 7.0. After some instrumentation,
it appears that the type_info::before() implementation provide by
XL C++ on AIX is buggy. It returns true for two different type_info
objects that point to the same type. It is actually quite obvious
why when one examines the implementation you have shown before:

inline bool type_info::before(const type_info&x) const {
  return (&x!=this) && (strcmp(x.mangledName,this->mangledName)>=0);
}

The last comparison should be >, not >=.

I've come up with a work around for this problem which makes the
test run as expected on AIX. The changes are only to libxsd so
you can apply them to your copy of XSD 3.2.0:

http://codesynthesis.com/~boris/tmp/xsd-3.2.0-xlc-aix.patch

> Can you think of any more issues that using the '--custom-type
> batman=/batman_base' with polymorphism might cause.  There are no
> other methods that the batman class needs to implement, or global
> operators?

No, the test looks fine. The only thing I had to do is add public:
to make the members in supermen_wrapper.h accessible.

Boris




More information about the xsd-users mailing list