[omniORB] Problem passing an array of structs

Thomas Lockhart lockhart at fourpalms.org
Fri May 18 17:14:39 BST 2007


>  Apparently operator[] is overloaded in omniORB only for unsigned int.
>  When I changed the index variable i in line 90 from "int i" to
>  "unsigned int i" everything worked. The error message is somewhat
>  less than transparent in pointing to the problem.

Right.

>  Is there a reason for requiring unsigned ints? If so, is there a way
>  to give the hapless user a more helpful error message?

Unsigned int means that you (that is, omniORB marshalling) does not need 
to do bounds checking for negative values. If one supported both signed 
and unsigned ints with explicit code (for example, having a signed int 
signature which does checks and then calls the current method), then the 
amount of generated code would increase.

It may be that the C++ mapping standard requires support for unsigned 
int and disallows support for signed ints, but I haven't looked to 
verify this.

Unfortunately, the error message is coming from the compiler. No chance 
to fix that without also changing the code the compiler is reading.

hth

- Tom



More information about the omniORB-list mailing list