[omniORB] IDL formal parameter name clash

Duncan Grisby duncan at grisby.org
Tue May 3 11:28:11 BST 2005


On Tuesday 3 May, Brian Wallis wrote:

> On Friday 29 April 2005 9:00 pm, Duncan Grisby <duncan at grisby.org> wrote:
> > omniidl is correct. Using the module name introduces it into the scope
> > of the operation parameters. See section 3.15.2 of the CORBA 2.6 spec.
> > It says:
> 
> Hmm. I did read that section and wondered if it applied to formal parameter 
> names. I'm not convinced that it does. 

It definitely does. See the example invalid IDL in section 3.2.3:

  void doit (
    in Foo foo // error: Foo and foo collide and refer to
                 different things
  );

If that's illegal, the IDL you quoted must also be illegal since there
aren't any other rules that would make this example illegal.

> Does the formal parameter name introduce a name into the scope that
> can be used for anything? I thought formal parameter names are just a
> placeholder in the IDL.

The name can't be used for anything, but the IDL spec says the names are
introduced, so that's what omniidl does.

> I've tried a number of other IDL compilers (TAO 1.4.4, JDK 1.4.2 and
> 1.5 idlj, fnorb fnidl 1.3) that are happy with this. Orbix 2000 1.2.3
> on the other hand gets an error.

Like I said, omniidl is much more strict about adhering to the spec than
most IDL compilers.

> But on testing, If I modify the IDL like so:
> 
> module aSAP {
>   typedef long ASAP_T;
> };
> 
> interface Test {
>   void getASAP(
>     in string aSAPName,
>     out ::aSAP::ASAP_T aSAP);
> };
> 
> ie: explicitly scope the aSAP module to global scope then everyone is happy 
> including omniORB. I suppose that in this case the aSAP module name is not 
> introduced into that scope?

Yes. Quoting a bit more of section 3.15.2:

  A qualified name of the form "::X::Y::Z" does not cause "X" to be
  introduced, but a qualified name of the form "X::Y::Z" does.

> All somewhat beside the point since I shouldn't need to modify IDL that is 
> part of a published standard (TMF814). Perhaps I need to bug report this to 
> the TMF.

It's definitely a bug in their IDL. You should file a bug report.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list