[omniORB] Case problems in IDL

David Riddoch djr@uk.research.att.com
Thu, 2 Sep 1999 19:13:41 +0100 (GMT)


On Thu, 2 Sep 1999, Craig Rodrigues wrote:

> If I have the following bit of IDL:
> 
> 
>      typedef sequence<short> Somethings;
> 
>       struct someStruct{
>           Somethings somethings;
>       };

The name 'somethings' clashes with 'Somethings', since they only differ in
case.

The rule is that identifiers are not case sensitive - so you cannot have
two identifiers in the same scope which differ only in case.  Further,
once you have chosen the capitalisation for an identifier you must be
consistent.

But you say, "Somethings is in a different scope to somethings".

However, on page 3-48 or the CORBA 2.3 spec we have:

 "An identifier from a surrounding scope is introduced into a scope if it
  is used in that scope."

Thus 'Somethings' is introduced into the scope of 'someStruct', and so    
clashes with 'somethings'.

You are okay if you do:

            ::Somethings somethings;


> omniidl2 will flag this as an error:
> line 6: redefinition after use, ::someStruct::somethings, ::someStruct,
>  ::Somethings
> bin/powerpc_aix_4.2/omniidl2: test4.idl: found 2 errors
> 
> What are the CORBA rules about the case of type and variable names?

See chapter 3 of the spec for more details.


> I tried compiling the same bit of IDL under TAO, Orbacus, and Visibroker,
> and none of those IDL compilers complained.

I think they are wrong in this case.


Cheers,
David