No subject


Fri Sep 2 03:59:05 CDT 2011


wever, if you have an idea how to silence this new warning, I'm fine with t=
hat too.


- Paul


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1767/#review5607
-----------------------------------------------------------


On Feb. 22, 2012, 11:15 p.m., Paul Belanger wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1767/
> -----------------------------------------------------------
> =

> (Updated Feb. 22, 2012, 11:15 p.m.)
> =

> =

> Review request for Asterisk Developers.
> =

> =

> Summary
> -------
> =

> I spend sometime cleaning up the compiler warnings, some big issues revol=
ve around the fact that read() and write() return values are ignored.  Not =
safe from what I read.  Any suggestions / recommendations if I have handled=
 it right?
> =

> =

> Diffs
> -----
> =

>   branches/1.8/addons/ooh323c/src/memheap.c 356432 =

>   branches/1.8/addons/ooh323c/src/ooCapability.c 356432 =

>   branches/1.8/addons/ooh323c/src/ooSocket.c 356432 =

>   branches/1.8/addons/ooh323c/src/ooTimer.c 356432 =

>   branches/1.8/addons/ooh323c/src/ooq931.c 356432 =

>   branches/1.8/addons/ooh323c/src/perutil.c 356432 =

>   branches/1.8/addons/ooh323cDriver.c 356432 =

> =

> Diff: https://reviewboard.asterisk.org/r/1767/diff
> =

> =

> Testing
> -------
> =

> compiling testing on development box.
> =

> =

> Thanks,
> =

> Paul
> =

>


--===============7147827635701266502==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable




<html>
 <body>
  <div style=3D"font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor=3D"#f9f3c9" width=3D"100%" cellpadding=3D"8" style=3D"bor=
der: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href=3D"https://reviewboard.asterisk.org/r/1767/">https://reviewbo=
ard.asterisk.org/r/1767/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; padd=
ing-left: 10px;">
 <p style=3D"margin-top: 0;">On February 23rd, 2012, 9:11 a.m., <b>Matt Jor=
dan</b> wrote:</p>
 <blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; pad=
ding-left: 10px;">
  =




<table width=3D"100%" border=3D"0" bgcolor=3D"white" style=3D"border: 1px s=
olid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan=3D"4" bgcolor=3D"#F0F0F0" style=3D"border-bottom: 1px solid =
#C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href=3D"https://reviewboard.asterisk.org/r/1767/diff/1/?file=3D24523=
#file24523line103" style=3D"color: black; font-weight: bold; text-decoratio=
n: underline;">branches/1.8/addons/ooh323cDriver.c</a>
    <span style=3D"font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style=3D"background-color: #e4d9cb; padding: 4px 8px; text-align: c=
enter;">
  <tr>

   <td colspan=3D"2"><pre style=3D"font-size: 8pt; line-height: 140%; margi=
n: 0; ">void* ooh323c_call_thread(void* dummy)</pre></td>
   <td colspan=3D"2"><pre style=3D"font-size: 8pt; line-height: 140%; margi=
n: 0; ">int ooh323c_call_thread(void* dummy)</pre></td>

  </tr>
 </tbody>



 =

 =





 <tbody>

  <tr>
    <th bgcolor=3D"#e9eaa8" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2">103</font></th>
    <td bgcolor=3D"#fdfebc" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">	<span class=3D"k">if</span> <span class=3D"p"=
>(</span><span class=3D"n">ooPDRead</span><span class=3D"p">(</span><span c=
lass=3D"n">pfds</span><span class=3D"p">,</span> <span class=3D"mi">1</span=
><span class=3D"p">,</span> <span class=3D"n">mycthread</span><span class=
=3D"o">-&gt;</span><span class=3D"n">thePipe</span><span class=3D"p">[</spa=
n><span class=3D"mi">0</span><span class=3D"p">]))</span></pre></td>
    <th bgcolor=3D"#e9eaa8" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">103</font></th>
    <td bgcolor=3D"#fdfebc" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">	<span class=3D"k">if</span> <span class=3D"p"=
>(</span><span class=3D"n">ooPDRead</span><span class=3D"p">(</span><span c=
lass=3D"n">pfds</span><span class=3D"p">,</span> <span class=3D"mi">1</span=
><span class=3D"p">,</span> <span class=3D"n">mycthread</span><span class=
=3D"o">-&gt;</span><span class=3D"n">thePipe</span><span class=3D"p">[</spa=
n><span class=3D"mi">0</span><span class=3D"p">]))</span><span class=3D"hl"=
> </span><span class=3D"p"><span class=3D"hl">{</span></span></pre></td>
  </tr>

  <tr>
    <th bgcolor=3D"#e9eaa8" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2">104</font></th>
    <td bgcolor=3D"#fdfebc" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">		<span class=3D"n">res</span> <span class=3D"=
o">=3D</span> <span class=3D"n">read</span><span class=3D"p">(</span><span =
class=3D"n">mycthread</span><span class=3D"o">-&gt;</span><span class=3D"n"=
>thePipe</span><span class=3D"p">[</span><span class=3D"mi">0</span><span c=
lass=3D"p">],</span> <span class=3D"o">&amp;</span><span class=3D"n">c</spa=
n><span class=3D"p">,</span> <span class=3D"mi">1</span><span class=3D"p">)=
<span class=3D"hl">;</span></span></pre></td>
    <th bgcolor=3D"#e9eaa8" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">104</font></th>
    <td bgcolor=3D"#fdfebc" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "><span class=3D"hl">		</span><span class=3D"k">=
<span class=3D"hl">if</span></span><span class=3D"hl"> </span><span class=
=3D"p"><span class=3D"hl">((</span></span><span class=3D"n">res</span> <spa=
n class=3D"o">=3D</span> <span class=3D"n">read</span><span class=3D"p">(</=
span><span class=3D"n">mycthread</span><span class=3D"o">-&gt;</span><span =
class=3D"n">thePipe</span><span class=3D"p">[</span><span class=3D"mi">0</s=
pan><span class=3D"p">],</span> <span class=3D"o">&amp;</span><span class=
=3D"n">c</span><span class=3D"p">,</span> <span class=3D"mi">1</span><span =
class=3D"p">)<span class=3D"hl">)</span></span><span class=3D"hl"> </span><=
span class=3D"o"><span class=3D"hl">&lt;</span></span><span class=3D"hl"> <=
/span><span class=3D"mi"><span class=3D"hl">1</span></span><span class=3D"p=
"><span class=3D"hl">)</span></span><span class=3D"hl"> </span><span class=
=3D"p"><span class=3D"hl">{</span></span></pre></td>
  </tr>

 </tbody>



 =

 =




 <tbody>

  <tr>
    <th bgcolor=3D"#b1ebb0" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2"></font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "></pre></td>
    <th bgcolor=3D"#b1ebb0" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">105</font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">			<span class=3D"k">return</span> <span class=
=3D"n">res</span><span class=3D"p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor=3D"#b1ebb0" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2"></font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "></pre></td>
    <th bgcolor=3D"#b1ebb0" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">106</font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">		<span class=3D"p">}</span></pre></td>
  </tr>

  <tr>
    <th bgcolor=3D"#b1ebb0" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2"></font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "></pre></td>
    <th bgcolor=3D"#b1ebb0" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">107</font></th>
    <td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; ">	<span class=3D"p">}</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style=3D"white-space: pre-wrap; white-space: -moz-pre-wrap; white-sp=
ace: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Returning=
 here changes the behavior of this function.  If res is unused, then - from=
 the perspective of only fixing a compiler warning, and not change the sema=
ntics of this portion of the code - you shouldn&#39;t check the return valu=
e of this call.

That being said, Alexander Anikin (may123) is the man when it comes to chan=
_ooh323, so you should probably ask him.

</pre>
 </blockquote>





</blockquote>
<pre style=3D"margin-left: 1em; white-space: pre-wrap; white-space: -moz-pr=
e-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-=
word;">Ya, I am fine with that, however it would create another warning:

ooh323cDriver.c:103:7: error: ignoring return value of &#39;read&#39;, decl=
ared with attribute warn_unused_result [-Werror=3Dunused-result]



More information about the asterisk-dev mailing list