ORBit2 and const char *



I recently took a look at the CORBA C mapping documentation. I noticed 
that it requires use of "char *" for string, not "const char *".

In ORBit and ORBit2, we decided to take a non-standard approach (or maybe 
it's allowed by the standard, and I just read it wrong) and use "const 
char *" for string parameters. Unfortunately, the implementation we have 
doesn't work right for string typedefs.

The special case hack in the IDL compiler still generates:

      typedef char *MyModule_MyString;
      void MyModule_MyInterface_MyFunction(const MyModule_MyString);

if you do something like:

     module MyModule {
         typedef string MyString;
         interface MyInterface {
             void MyFunction(in MyString);
         }
     }

And it also doesn't do the casting correctly when creating the calls to 
_impl_copy in the skels, so you get warnings at compile time from gcc. 
What should we do about this? Here are some possible "solutions":

     1) get fancy somehow so that we use const char * instead of const 
MyModule_MyString
     2) abandon use of const char * in ORBit2 to comply with the OMG spec.
     3) avoid typedefs for string types in IDLs
     4) change the casting to get rid of the warnings when compiling skels

Thoughts?

     -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]