Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2016 11:29:53 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Don Lewis <truckman@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r299584 - head/usr.sbin/binmiscctl
Message-ID:  <20160513111917.N10080@besplex.bde.org>
In-Reply-To: <201605130114.u4D1Edeg031694@repo.freebsd.org>
References:  <201605130114.u4D1Edeg031694@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 13 May 2016, Don Lewis wrote:

> Log:
>  Mark usage() as __dead2 so that Coverity doesn't think that execution
>  continues after the call and uses a negative array subscript.
>
>  Reported by:	Coverity
>  CID:		1305629

This was just a bug in Coverity.  Now it is also a style bug.

usage() doesn't return since it finishes with exit() and this is marked
with __dead2.

It is a style bug to declare usage() and similar functions that obviously
don't return as __dead2.  Thus can only be obvious only obvious for static
function.  Coverity should do more global checking and not need this markup
for some extern functions.  Even lint can do that.

Only about 32 of 451 declarations of usage() in /usr/src have this style
bug.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160513111917.N10080>