From owner-svn-src-head@freebsd.org Sun May 29 08:04:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB941B4FE2E; Sun, 29 May 2016 08:04:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 764B81BE1; Sun, 29 May 2016 08:04:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-42-169.carlnfd1.nsw.optusnet.com.au [110.21.42.169]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id ED2E81A5DED; Sun, 29 May 2016 17:31:39 +1000 (AEST) Date: Sun, 29 May 2016 17:31:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300935 - head/usr.sbin/rpc.statd In-Reply-To: <201605290418.u4T4IlWI057643@repo.freebsd.org> Message-ID: <20160529171235.A1958@besplex.bde.org> References: <201605290418.u4T4IlWI057643@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=M8SwUHEs c=1 sm=1 tr=0 a=kDyANCGC9fy361NNEb9EQQ==:117 a=kDyANCGC9fy361NNEb9EQQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=___x2QKLYJCSEN0yLm8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2016 08:04:22 -0000 On Sun, 29 May 2016, Garrett Cooper wrote: > Log: > Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call exit > as a hint to static analysis tools This is bogus for usage() since it is static so only very broken static analyis tools can't see its full details. > Modified: head/usr.sbin/rpc.statd/statd.c > ============================================================================== > --- head/usr.sbin/rpc.statd/statd.c Sun May 29 04:02:02 2016 (r300934) > +++ head/usr.sbin/rpc.statd/statd.c Sun May 29 04:18:47 2016 (r300935) > @@ -72,9 +72,9 @@ static int create_service(struct netconf > static void complete_service(struct netconfig *nconf, char *port_str); > static void clearout_service(void); > static void handle_sigchld(int sig); > -void out_of_mem(void); > +void out_of_mem(void) __dead2; This is even more bogus: - out_of_mem() is public, and this adds __dead2 in the one place that clearly doesn't need it - the declarartions are unsorted internally and externally. Prototypes for public functions belong in a header file. Some are already there, but this one is unsorted into the middle of static ones - however, perhaps this function should be static. It is only directly referenced in this file. I don't know if it is also referenced in some other utility or rpc generated code. If so, then these are probably missing the __dead2. > -static void usage(void); > +static void usage(void) __dead2; There are also many lexical (indentation) style bugs near here, in all of the newer prototypes starting with handle_sigchld(). > > int > main(int argc, char **argv) > @@ -613,7 +613,7 @@ clearout_service(void) > } > > static void > -usage() > +usage(void) Perhaps Coverity was just complaining about this K&R definition. No change was needed, since there is a prototype in scope. Bruce