[prev in list] [next in list] [prev in thread] [next in thread] 

List:       omniorb-list
Subject:    [omniORB] Compile warning on SLES10(32), gcc 4.1.0
From:       "Enver Cicak" <Enver.Cicak () hermes-softlab ! com>
Date:       2006-10-30 13:31:18
Message-ID: 805CE00B77524B45B4689B51901BB4C83FF1BA () hsl-lj-mail ! hermes ! si
[Download RAW message or body]

--===============51518902303276337==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6FC27.ADBB963B"

This is a multi-part message in MIME format.


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

 


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1028" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi all,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>During code compile with (gcc version 4.1.0 , omniORB 4.0.7)
I had warning <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&#8230;/include/omniORB4/CORBA_Any.h: In constructor
âCORBA::Any::to_string::to_string(const char*&amp;, \
CORBA::ULong)â:&#8221;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&#8230;/include/omniORB4/CORBA_Any.h:208: warning: cast from
type âconst char**â to type âchar**â casts away \
constness<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&#8230;/include/omniORB4/CORBA_Any.h: In constructor
âCORBA::Any::to_wstring::to_wstring(const CORBA::WChar*&amp;, \
CORBA::ULong)â:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&#8230;/include/omniORB4/CORBA_Any.h:215: warning: cast from
type âconst CORBA::WChar**â to type âCORBA::WChar**â casts away \
constness<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I removed warning by changing following lines in CORBA_Any.h
file<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>  struct to_string {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>-    to_string(const char*&amp; s, ULong b) :
val((char*&amp;)s), bound(b) { }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+    to_string(const char*&amp; s, ULong b) :
val(OMNI_CONST_CAST(char*&amp;, s)), bound(b) { }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    to_string(char*&amp; s, ULong b) : val(s), bound(b) { }
// deprecated<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    char*&amp; val;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    ULong bound;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>  };<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>  struct to_wstring {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>-    to_wstring(const WChar*&amp; s, ULong b) :
val((WChar*&amp;)s), bound(b) { }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>+    to_wstring(const WChar*&amp; s, ULong b) :
val(OMNI_CONST_CAST(WChar*&amp;, s)), bound(b) { }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    to_wstring(WChar*&amp; s, ULong b) : val(s), bound(b) {
} // deprecated<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    WChar*&amp; val;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>    ULong bound;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>  };<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>            Enver<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>



_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list

--===============51518902303276337==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic