From owner-svn-src-head@freebsd.org Fri Aug 28 12:48:30 2015 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 1EB959C4086; Fri, 28 Aug 2015 12:48:30 +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 DAFE91A70; Fri, 28 Aug 2015 12:48:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id EAD911A2243; Fri, 28 Aug 2015 22:17:57 +1000 (AEST) Date: Fri, 28 Aug 2015 22:17:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd In-Reply-To: <201508271811.t7RIB0xl077002@repo.freebsd.org> Message-ID: <20150828215109.G1227@besplex.bde.org> References: <201508271811.t7RIB0xl077002@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=L4TgOLn8 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JJXoQN_ZqqusbX7kRnQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 12:48:30 -0000 On Thu, 27 Aug 2015, Xin LI wrote: > Log: > die() would never return, mark it as so. Why? (Except to add a style bug.) > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================================== > --- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015 (r287216) > +++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015 (r287217) > @@ -324,7 +324,7 @@ static const char *cvthname(struct socka > static void deadq_enter(pid_t, const char *); > static int deadq_remove(pid_t); > static int decode(const char *, const CODE *); > -static void die(int); > +static void die(int) __dead2; Since the function is static, it is very easy for the compiler to see that it doesn't return. Even gcc-4.2.1 does this by default, since -O implies -funit-at-a-time for gcc-4.2.1. For clang, there is no way to prevent this (except possibly -O0) since, since -fno-unit-at-a-time is broken in clang. Several other functions in the same file are still missing this style bug: - usage(). The style bug is clearly documented for usage() by its absence in style(9) and in most files that have usage(). Howvever, about 30 declarations of usage() in /usr/src have the style bug. - timedout(). This is a signal handler, so doesn't really need it. This is broken signal handler. It carefully uses _exit() so as to not use stdio in a signal handler, but defeats this by also using errx(). Bruce