[omniORB] omniORB4: problem marshaling boolean arrays/sequences

omniorb@laurelnetworks.com omniorb@laurelnetworks.com
Fri Oct 11 22:24:00 2002


<omniORB4/seqTemplatedefns.h> tells us that marshaling of _CORBA_Boolean
sequences and arrays is handed off to cdrStream's put_octet_array() and
get_octet_array() methods after coercing the _CORBA_Boolean* to _CORBA_Octet*.

This, of course, is only valid when _CORBA_Boolean and _CORBA_Octet are the
same size.  But <omniORB4/CORBA_basetypes.h> says:

    #ifdef HAS_Cplusplus_Bool
    typedef bool                      _CORBA_Boolean;
    #else
    typedef unsigned char             _CORBA_Boolean;
    #endif

and

    typedef unsigned char             _CORBA_Octet;

so they are only the same size when !defined(HAS_Cplusplus_Bool) or when
sizeof(bool) == sizeof(unsigned char) (== 1), which is not always true.
This leads to interoperability problems.

Bradley