[PolyORB-users] Type generated for array dimension
Kellogg, Oliver
Oliver.Kellogg at cassidian.com
Thu Jun 16 13:20:10 CEST 2011
Hello polyorb-users,
I just found an interesting incompatibility between iac and
CORBA/IDL2Ada.pm regarding the data type generated for an array typedef
dimension involving an IDL const. Example:
module tst {
const short dim = 3;
typedef boolean arr_t[dim];
};
For arr_t, iac generates:
type arr_t is array (0 .. 2) of CORBA.Boolean;
while CORBA/IDL2Ada.pm generates:
type arr_t is array (0 .. dim - 1) of CORBA.Boolean;
This may impact applications. For example, in our Ada code we used:
declare
subtype Dim_T is CORBA.Short range 0 .. tst.dim - 1;
Arr : tst.arr_t;
begin
for I in Dim_T loop
Arr (I) := True;
end loop;
end;
This gave a syntax error when used with iac generated code because of an
index type mismatch (expecting Integer not CORBA.Short)
I am changing CORBA/IDL2Ada.pm to follow the iac code generation.
-- Oliver
More information about the PolyORB-users
mailing list