From owner-svn-src-all@freebsd.org Fri Jan 26 10:49:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 984D8ECF653; Fri, 26 Jan 2018 10:49:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9D40A6DDFC; Fri, 26 Jan 2018 10:49:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 695C8D438CE; Fri, 26 Jan 2018 21:49:36 +1100 (AEDT) Date: Fri, 26 Jan 2018 21:49:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328430 - head/sbin/devd In-Reply-To: Message-ID: <20180126212938.E1040@besplex.bde.org> References: <201801260440.w0Q4efhg008105@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.2 cv=YbvN30Zf c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=9zjIyH2LsWiY7TYil1EA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 10:49:42 -0000 On Fri, 26 Jan 2018, Ed Schouten wrote: > static void usage(void) __dead2; > > This should be spelled: > > [[noreturn]] static void usage(); That would be as silly as __dead2, and has a worse syntactic style (attributes before the return type mess up the formatting). It is obvious even to lint that usage() doesn't return, since it finishes with exit() and exit() is declared as not returning. (lint in FreeBSD was actually documented as not understanding exit(), and it never understood __dead2 or C++, so usage() and all other uses of exit() would need /* NOTREACHED */ after them for lint, but that would be even uglier than [[noreturn]] and the style bug of doing it for usage() is less common than the style bug of declaring usage() as __dead2.) This file has further style bugs which make the whole prototype dead. With normal style, or even with functions sorted alphabetically, main() is before usage() so a forward declaration of usage() is needed. However, in this file, usage() is before main(). Also, this file usage a random style for declaring forward prototypes when they are not needed. It declares unnecessary ones for usage() and event_loop(), and a necessary one for devdlog(), but doesn't declare unnecessary ones for approx. 5 other functions. Bruce