From owner-freebsd-hackers@freebsd.org Mon Jan 1 19:15:27 2018 Return-Path: Delivered-To: freebsd-hackers@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 58E9FEB832D for ; Mon, 1 Jan 2018 19:15:27 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107B478C9B for ; Mon, 1 Jan 2018 19:15:26 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w01JFL4k087716; Mon, 1 Jan 2018 11:15:21 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w01JFLS5087715; Mon, 1 Jan 2018 11:15:21 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201801011915.w01JFLS5087715@pdx.rh.CN85.dnsmgr.net> Subject: Re: Is it considered to be ok to not check the return code of close(2) in base? In-Reply-To: To: Warner Losh Date: Mon, 1 Jan 2018 11:15:21 -0800 (PST) CC: Larry McVoy , FreeBSD Hackers , Poul-Henning Kamp X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Mon, 01 Jan 2018 21:31:47 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jan 2018 19:15:27 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Jan 1, 2018 at 10:55 AM, Rodney W. Grimes < > freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Mon, Jan 01, 2018 at 08:52:57AM -0800, Rodney W. Grimes wrote: > > > > > On Mon, Jan 01, 2018 at 04:14:33PM +0000, Poul-Henning Kamp wrote: > > > > > > But this is bikeshedding at this point anyway. > > > > > > > > > > +1 > > > > > > > > Bike shedding is good, people learn things from it. I never knew that > > > > assert was altered by NDEBUG for example, thanks for that enlightenment > > > > > > Um, does the FreeBSD man page not start like the Linux man page with > > > > > > If the macro NDEBUG was defined at the moment > > was last > > > included, the macro assert() generates no code, and hence does > > nothing > > > at all. > > > > > > ? > > > > It further says that an assert() appeared in V6, and I bet that NDEBUG > > didnt exist at that time. > > > http://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/include/assert.h says by > at least v7 it was there. The man page appears to be incorrect that it > appeared in V6 unix, as I can find no file named *assert* in the two > distributions available at TUHS, nor could grep turn up anything on assert > apart from: > > doc/c/c3:an assertion that when a construction of > > So it was definitely in V7 (I'll fix the man page), and had NDEBUG from the > start. Please do not do that, so far I have found in a v6 pwb: #define ASSERT(p) #ifdef debug #define ASSERT(p) if(!(p))botch("p");else botch(s) char *s; { printf("assertion botched: %s\n",s); abort(); } #endif Which is more of how I rember it being, not the presence of NDEBUG cleaning the code of asserts, but the lack of DEBUG. The online manual pages for v6 are abismal compared to the printed hard copies. I have a set in storage, I'll retrieve them and see what is there. -- Rod Grimes rgrimes@freebsd.org