[omniORB] omniORB4 idl compiler code generation issue

Terry Lee terryl at wt.net
Sun Dec 4 13:43:03 GMT 2005


Hi,

I have encountered problems when compiling source generated
by omniidl when the idl file has typedefs like this:

module MyObjects {
  typedef octet CmdBuf_t [1024];
...
};

In the generated .h file I see inline functions
like this:

  typedef CORBA::Octet CmdBuf_t[1024];
  typedef CORBA::Octet CmdBuf_t_slice;

  _CORBA_MODULE_VAR inline CmdBuf_t_slice* CmdBuf_t_alloc() {
    return new CmdBuf_t_slice[1024];
  }

The problem is that _CORBA_MODULE_VAR is defined
as extern and this does not compile on all platforms
for example on IRIX:

cc-1300 CC: ERROR File = HDSObjects.h, Line = 65
  "inline" is not allowed.

_CORBA_MODULE_VAR inline CmdBuf_t_slice* CmdBuf_t_alloc() {

In omniORB3 this kind of typedef was generated as a
"static inline" and this code works fine.

In fact I wonder if doing "_CORBA_MODULE_VAR inline"
in this case is really correct on any platform,
even if it is tolerated.

I looked but did not see any mention of this in the
omniORB mailing list. Am I correct in thinking that this
is an issue that can be fixed? Currently I am
"post-processing" the .h files generated by omniidl.

Thanks,

Terry





More information about the omniORB-list mailing list