From owner-svn-src-head@FreeBSD.ORG Fri Nov 30 09:30:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5396892; Fri, 30 Nov 2012 09:30:31 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id 093528FC19; Fri, 30 Nov 2012 09:30:31 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp2.one.com (Postfix) with ESMTPA id 81A72304042C; Fri, 30 Nov 2012 09:30:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243665 - head/sbin/dump From: Erik Cederstrand In-Reply-To: <20121129120147.GE3013@kib.kiev.ua> Date: Fri, 30 Nov 2012 10:30:25 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9E5035D8-506F-4A18-9511-BFA0511ACE10@cederstrand.dk> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 30 Nov 2012 09:30:31 -0000 Den 29/11/2012 kl. 13.01 skrev Konstantin Belousov = : > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Thu Nov 29 05:16:50 2012 >> New Revision: 243665 >> URL: http://svnweb.freebsd.org/changeset/base/243665 >>=20 >> Log: >> Mark non-returning function as such >>=20 >> PR: bin/172978 >> Approved by: cperciva >> MFC after: 3 days >>=20 >> Modified: >> head/sbin/dump/dump.h >>=20 >> Modified: head/sbin/dump/dump.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 = (r243664) >> +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 = (r243665) >> @@ -121,7 +121,7 @@ void trewind(void); >> void writerec(char *dp, int isspcl); >>=20 >> void Exit(int status) __dead2; >> -void dumpabort(int signo); >> +void dumpabort(int signo) __dead2; >> void dump_getfstab(void); >>=20 >> char *rawname(char *cp); > What is the goal of this change ? >=20 > It is arguably backward. There is absolutely no use to mark signal = handler > as __dead2, and all other uses do not benefit from the redundand = declaration. I submitted this patch because it fixes static analysis warnings. = Compilation units that contain the header but not the implementation = need this to reason about the code. As I see it, the __dead2 is part of the function definition, just like = 'void' and 'int signo'. Actually, before the patch, return type 'void' = was a lie, because the function never returns. > Also, being quite removed from the function definition, there is a = chance > that some future modification would make the attribute a lie. That is not any different than some future modification changing the = return type to 'int', which the compiler would also warn about. Thanks, Erik=