From owner-svn-src-all@freebsd.org Fri Jan 19 18:39:03 2018 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 9FAE6EC108C; Fri, 19 Jan 2018 18:39:03 +0000 (UTC) (envelope-from freebsd@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 5E5236E18F; Fri, 19 Jan 2018 18:39:02 +0000 (UTC) (envelope-from freebsd@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 w0JIcwC5073371; Fri, 19 Jan 2018 10:38:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w0JIcwdE073370; Fri, 19 Jan 2018 10:38:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201801191838.w0JIcwdE073370@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327354 - head/sys/vm In-Reply-To: To: Warner Losh Date: Fri, 19 Jan 2018 10:38:58 -0800 (PST) CC: "Conrad E. Meyer" , Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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, 19 Jan 2018 18:39:03 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Jan 18, 2018 at 1:32 PM, Conrad Meyer wrote: > > > On Thu, Jan 18, 2018 at 12:01 PM, Eric van Gyzen > > wrote: > > > On 01/17/2018 16:40, Gleb Smirnoff wrote: > > >> Yeah, style is sacred, but is there a single person on Earth who would > > >> not agree that moving variables from smaller blocks to function block > > >> reduces readability of the code? > > > > > > I agree that it reduces the readability. Not only that, it also > > > encourages real bugs by allowing access to the variable when it does not > > > make sense. > > > > I think the right way to propose this kind of policy change is to get > > agreement on how style(9) should be modified ? not arbitrarily go > > against style(9) in some files. The proposed change may be somewhat > > contentious and it might be a good exercise to go through the FreeBSD > > Community Process. > > > > I might separate these two concerns: > > > > 1. Allowing local / block scoped variables > > 2. Allowing C99 for loop initial declarations > > > > But I could see the argument that (2) is just a boring subset of (1). > > > > Tell me again where #1/#2 are disallowed? I can't seem to find that in > style(9), except by a weak example of there being no examples of #1 or #2. I think everyone glossed over: Parts of a for loop may be left empty. Do not put declarations inside blocks unless the routine is unusually complicated. Perhaps that second sentence should be extracted into a paragraph of its own? This does sound very much like what you said that you do in another reply in this thread. > Warner -- Rod Grimes rgrimes@freebsd.org