[omniORB] Patch: removed const_cast warnings

matejkenda@volja.net matejkenda@volja.net
Thu Jan 9 16:27:02 2003


Gary,

Thanks for the tip. I followed the implementation that was already there, but I
will try to revert all similar casts to use a macro.

Regards,

Matej

> -----Original Message-----
> From: Gary Duzan [mailto:gduzan@bbn.com]
> Subject: Re: [omniORB] Patch: removed const_cast warnings
>
> =>I have noticed that omniORB's include files make some
> warnings when -Wcast-qual
> =>option is used (g++ 3.2 on Linux).
> =>
>
>    You might consider using a macro, instead. Something like:
>
> #ifdef HAS_Cplusplus_const_cast
> #define CONST_CAST(t,v) const_cast<t>(v)
> #else
> #define CONST_CAST(t,v) (t)v
> #endif
>
> Then:
>
>        arg_0((char*)a_0) {}
>
> becomes:
>
>        arg_0(CONST_CAST(char*,a_0)) {}
>