From owner-svn-src-all@freebsd.org Sun Aug 30 05:55:28 2015 Return-Path: Delivered-To: svn-src-all@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 BDDC69C5C31; Sun, 30 Aug 2015 05:55:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFADF11; Sun, 30 Aug 2015 05:55:28 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 4C4FF42406D; Sun, 30 Aug 2015 15:36:28 +1000 (AEST) Date: Sun, 30 Aug 2015 15:36:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Joerg Sonnenberger cc: Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd In-Reply-To: <20150828143847.GA24222@britannica.bec.de> Message-ID: <20150830151625.K1159@besplex.bde.org> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> 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=C/8Usl7+ c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=mGv_DlIlq0PPiHA2Y44A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Sun, 30 Aug 2015 05:55:28 -0000 On Fri, 28 Aug 2015, Joerg Sonnenberger wrote: > On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote: >>> -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. > > But the compiler can't tell if it is the *intention* that the function > never returns. The warning behavior exists because that can easily > change with macros etc. The compiler should trust the programmer to write correct functions. >> 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. > > It is not broken. It is loadly ignored as unsupported. The very > existance of the option in GCC has always been a concession to broken > and badly written code, including of course GCC's own CRT. Unsupported == incompatible == broken. My use of this option can probably be reduced to -fno-toplevel-reorder, but that is even more broken in clang (it and -ftoplevel-reorder are "unknown arguments", while -fno-unit-at-a-time is an "unsupported optimization", and -funit-at-a-time works). Bruce