From owner-svn-src-all@FreeBSD.ORG Wed Dec 7 17:30:29 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2915F106567B; Wed, 7 Dec 2011 17:30:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id B7ADC8FC14; Wed, 7 Dec 2011 17:30:28 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pB7HUQAj022580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Dec 2011 04:30:27 +1100 Date: Thu, 8 Dec 2011 04:30:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20111207155309.GH50300@deviant.kiev.zoral.com.ua> Message-ID: <20111208041138.Q2451@besplex.bde.org> References: <201112071525.pB7FPmkH044896@svn.freebsd.org> <20111207155309.GH50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, brooks@FreeBSD.org, David Chisnall , src-committers@FreeBSD.org Subject: Re: svn commit: r228322 - in head: include lib/libc/stdlib sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 07 Dec 2011 17:30:29 -0000 On Wed, 7 Dec 2011, Kostik Belousov wrote: > On Wed, Dec 07, 2011 at 03:25:48PM +0000, David Chisnall wrote: >> Log: >> Implement quick_exit() / at_quick_exit() from C++11 / C1x. Also add a >> __noreturn macro and modify the other exiting functions to use it. >> ... >> +struct quick_exit_handler { >> + struct quick_exit_handler *next; >> + void (*cleanup)(void); >> +}; >> + >> +__attribute((weak)) >> +void _ZSt9terminatev(void); >> ... >> +{ >> + /* >> + * XXX: The C++ spec requires us to call std::terminate if there is an >> + * exception here. >> + */ >> + for (struct quick_exit_handler *h = handlers ; NULL != h ; h = h->next) > This fragment violates so many style requirements that I probably fail > to enumerate them all. > ... :-). And you didn't point the style violations in the __attribute(()) declaration above. These include - a hard-coded gccism - formatting of part of the declaration on a separate line - spelling __attribute__(()) unusually. I'm not sure what the weak attribute does by itself. only defines __weak_reference() and does it less unportably without using __attribute__(). > The h declaration shall go at the start of function, and not at the for > statement. The style rules may be different for C++. It is hard to know what they are since we don't have any. This declaration wouldn't even compile in C90, and style(9) barely supports that since it is based on K&R C. The declaration compiles in C99, but unnecessary use of C99 features is a style bug (because style(9) gives no examples of it). > ... Bruce