Discussion:
[omniORB] Compile warning on SLES10(32), gcc 4.1.0
Enver Cicak
2006-10-30 19:31:49 UTC
Permalink
Hi all,



During code compile with (gcc version 4.1.0 , omniORB 4.0.7) I had warning

.../include/omniORB4/CORBA_Any.h: In constructor ?CORBA::Any::to_string::to_string(const char*&, CORBA::ULong)?:"

.../include/omniORB4/CORBA_Any.h:208: warning: cast from type ?const char**? to type ?char**? casts away constness

.../include/omniORB4/CORBA_Any.h: In constructor ?CORBA::Any::to_wstring::to_wstring(const CORBA::WChar*&, CORBA::ULong)?:

.../include/omniORB4/CORBA_Any.h:215: warning: cast from type ?const CORBA::WChar**? to type ?CORBA::WChar**? casts away constness



I removed warning by changing following lines in CORBA_Any.h file



struct to_string {

- to_string(const char*& s, ULong b) : val((char*&)s), bound(b) { }

+ to_string(const char*& s, ULong b) : val(OMNI_CONST_CAST(char*&, s)), bound(b) { }

to_string(char*& s, ULong b) : val(s), bound(b) { } // deprecated



char*& val;

ULong bound;

};

struct to_wstring {

- to_wstring(const WChar*& s, ULong b) : val((WChar*&)s), bound(b) { }

+ to_wstring(const WChar*& s, ULong b) : val(OMNI_CONST_CAST(WChar*&, s)), bound(b) { }

to_wstring(WChar*& s, ULong b) : val(s), bound(b) { } // deprecated



WChar*& val;

ULong bound;

};



Regards,



Enver



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20061030/b58d1a70/attachment.htm
Loading...