From owner-svn-src-all@freebsd.org Thu Jan 18 21:15:19 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 21A3DEC393B for ; Thu, 18 Jan 2018 21:15:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4B10815D5 for ; Thu, 18 Jan 2018 21:15:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x22e.google.com with SMTP id f3so25756130wmc.1 for ; Thu, 18 Jan 2018 13:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YWiCkPWa+LjNa8SonQfmbTtE5ZfpLXE68uQ3t8gwNmo=; b=XGK6AaWyTs0gGokTjl3Jk+NWJ8ixTXwZ0UsW0p6NZIG4k151EPGXt/ovqND5IZwRMi trGiE8tTUSmEPA/91ZdusTVoEwK2xqkeJPThKdSiKVy3oNkjFjq2KYa5v8okcmMUhnnZ kZVdOFqIVz1P6xbgb9gxVkbhYYmi6jD+FHjV7ztHNLYB4WE9XnNqOEiHN9DCqexXxJpm /6x7PJuYi0kFYtAu2jPhfN0p4u2Q3XadCl478G2nciLXpe7IojOdiJLrd9ea2srDGAcF lXhEXugUcpRBMlqhvL5389dIgQ02aY9X796r+elii3ENZwjUuZg4M73JgPkqh0S69Kyn sBvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YWiCkPWa+LjNa8SonQfmbTtE5ZfpLXE68uQ3t8gwNmo=; b=UaXKlDcAPOlZgvrLoB9+6shS1gYrJ9oTK3LW3xm4ElvPSXHr9rhyXNDznCKqSWNppw 7yMvFiGWaFUWL0/orM6hylNwFI7oJ89Op8H0KhcGgUS6R+KonYhJ+Nnipi6hmSxyTnsy ksaC3n7pfAqGFWp0AWOHEd95RSOpMhxzcKFo9ux9CWODp7+8oLhq37ZJbl0TnydMTudb vobGj9u8Zb6Js0s+FaFbnwAt3MM+E3TfvHeNf8EQzc1OxfRjU+YMouANUWFLtP824tmP dnjUM8SOuOw4/Q9tsr13LFK715zg6x7enXGpUUOlXBpXRJEk/QfqEOLvKeJdsPQ6AtWl ZYIw== X-Gm-Message-State: AKwxyteRe7srN203vttoSCn8b5il39L1il81Qu1YGPaqZ3hc7gYUQAry n05qbj0927e+eu/C5utnOo8ohIXLUxA/OLlJsvM9Hw== X-Google-Smtp-Source: ACJfBovtVGSHF+ldEck2N+qFbOGKXjuoN1tJlFSVh0DNAZwIoeKG71UHzgESpcgFYkpwx+pk5t7nFgWzvd7tduiEhIc= X-Received: by 10.80.179.76 with SMTP id r12mr9745701edd.118.1516310116872; Thu, 18 Jan 2018 13:15:16 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.80.195.12 with HTTP; Thu, 18 Jan 2018 13:15:16 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201712291905.vBTJ57gI072871@repo.freebsd.org> <20180117224054.GO8113@FreeBSD.org> <601ee1a2-8f4e-518d-4c86-89871cd652af@vangyzen.net> From: Warner Losh Date: Thu, 18 Jan 2018 14:15:16 -0700 X-Google-Sender-Auth: fBWsnGKFygoR3AhwgqRtotOskt8 Message-ID: Subject: Re: svn commit: r327354 - head/sys/vm To: Matt Joras Cc: "Conrad E. Meyer" , Eric van Gyzen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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: Thu, 18 Jan 2018 21:15:19 -0000 On Thu, Jan 18, 2018 at 2:10 PM, Matt Joras wrote: > On Thu, Jan 18, 2018 at 1:04 PM, Warner Losh wrote: > > > >> 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. > > > > Warner > > > It is sort of implied by the sections stating the rules for declaring > variables: > "When declaring variables in functions declare them sorted by size, > then n alphabetical order; multiple ones per line are okay." > And this: > "/* Insert an empty line if the function has no local variables. */" > > I don't see a more explicit note about them. > Right. It's a weak argument at best. The rule I've seen followed is more like "if the function is too big, it's OK to have scope-local variables." Numerous examples of this can be found in the tree... More of a "don't do it gratuitously, rather use it only when it makes good sense." Warner