X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C7D3CE.6734074C@onstor-exch02.onstor.net>; Tue, 31 Jul 2007 15:56:25 -0800
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C7D3CE.6734074C"
Content-class: urn:content-classes:message
Subject: RE: Coverity issue
Date: Tue, 31 Jul 2007 15:56:24 -0800
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E04D201F6@onstor-exch02.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E04D2019D@onstor-exch02.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Coverity issue
Thread-Index: AcfTxYZGi1atwtxfT+O2ZlqdHmfqLAAAH7pAAAH5uEA=
References: <BB375AF679D4A34E9CA8DFA650E2B04E030E3667@onstor-exch02.onstor.net> <BB375AF679D4A34E9CA8DFA650E2B04E04D2019D@onstor-exch02.onstor.net>
From: "Amit Bothra" <amit.bothra@onstor.com>
To: "Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>,
	"Mike Lee" <mike.lee@onstor.com>
Cc: "dl-Software" <dl-software@onstor.com>

This is a multi-part message in MIME format.

------_=_NextPart_001_01C7D3CE.6734074C
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Max,

So should I do all of the following?

1.	Remove the noreturn type.
2.	Make all the function that use noreturn as return value to
return void instead.
3.	Add __attribute__((noreturn)) to these functions?

Thanks,
Amit




-----Original Message-----
From: Maxim Kozlovsky=20
Sent: Tuesday, July 31, 2007 4:00 PM
To: Mike Lee; Amit Bothra
Cc: dl-Software
Subject: RE: Coverity issue

Make it void, this is the very old version of gcc way to declare the
equivalent of __attribute__((noreturn)). Declaring function "volatile"
has no affect in the version of the gcc we are using.

>-----Original Message-----
>From: Mike Lee
>Sent: Tuesday, July 31, 2007 3:53 PM
>To: Amit Bothra
>Cc: dl-Software
>Subject: Coverity issue
>
>Hi Amit:
>
>Unfortunately, I was not able to find the details behind the coverity
rule:
>  Event useless_type_qualifier_on_return_type: type qualifier on return
>type is meaningless
>in the manuals I got from coverity training.
>
>However, based on what I googled, I think Coverity is complaining about
>line 23 below, where we typedef'ed noreturn as "volatile void" and then
use
>it as return type for a function.  The use of "volatile" on a function
>return type has no meaning; "volatile" is only meaningful it is applied
to
>a variable type.
>
>22   	#if defined(__GNUC__)
>23   	typedef volatile void noreturn;
>24   	#else
>25   	typedef void noreturn;
>26   	#endif
>
>I believe our choices are:
>a. change definition of noreturn to be line 25 only
>b. change signature of fs_abort() to be of type void
>
>I favor the second option since it is more localized, but I'd respect
>others' opinion.
>
>Thanks.
>-Mike


------_=_NextPart_001_01C7D3CE.6734074C
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7652.24">
<TITLE>RE: Coverity issue</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">Hi =
Max,</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">So =
should I do</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">all of</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT =
SIZE=3D2 FACE=3D"Courier New">the following</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">?</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN LANG=3D"en-us"> =
<FONT SIZE=3D2 FACE=3D"Courier New">Remove the noreturn =
type</FONT></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">.</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN LANG=3D"en-us"> =
<FONT SIZE=3D2 FACE=3D"Courier New">Make all the function that use =
noreturn</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">as return value to return void =
instead.</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN LANG=3D"en-us"> =
<FONT SIZE=3D2 FACE=3D"Courier New">Add =
__attribute__((noreturn))</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"> to these functions?</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Thanks,</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Amit</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>
<BR>
<BR>

<P DIR=3DLTR><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">-----Original Message-----<BR>
From: Maxim Kozlovsky<BR>
Sent: Tuesday, July 31, 2007 4:00 PM<BR>
To: Mike Lee; Amit Bothra<BR>
Cc: dl-Software<BR>
Subject: RE: Coverity issue</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Make it void, this is the very old version of gcc way to declare =
the equivalent of __attribute__((noreturn)). Declaring function =
&quot;volatile&quot; has no affect in the version of the gcc we are =
using.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;-----Original Message-----</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;From: Mike Lee</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Sent: Tuesday, July 31, 2007 3:53 PM</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;To: Amit Bothra</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Cc: dl-Software</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Subject: Coverity issue</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Hi Amit:</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Unfortunately, I was not able to find the details behind the =
coverity rule:</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;&nbsp; Event useless_type_qualifier_on_return_type: type =
qualifier on return</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;type is meaningless</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;in the manuals I got from coverity training.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;However, based on what I googled, I think Coverity is =
complaining about</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;line 23 below, where we typedef'ed noreturn as &quot;volatile =
void&quot; and then use</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;it as return type for a function.&nbsp; The use of =
&quot;volatile&quot; on a function</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;return type has no meaning; &quot;volatile&quot; is only =
meaningful it is applied to</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;a variable type.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;22&nbsp;&nbsp; &nbsp; #if defined(__GNUC__)</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;23&nbsp;&nbsp; &nbsp; typedef volatile void =
noreturn;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;24&nbsp;&nbsp; &nbsp; #else</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;25&nbsp;&nbsp; &nbsp; typedef void noreturn;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;26&nbsp;&nbsp; &nbsp; #endif</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;I believe our choices are:</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;a. change definition of noreturn to be line 25 =
only</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;b. change signature of fs_abort() to be of type =
void</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;I favor the second option since it is more localized, but I'd =
respect</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;others' opinion.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;Thanks.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&gt;-Mike</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"></SPAN></P>

</BODY>
</HTML>
------_=_NextPart_001_01C7D3CE.6734074C--
