From owner-svn-src-head@freebsd.org Thu Jan 18 21:15:19 2018 Return-Path: Delivered-To: svn-src-head@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 2061FEC393A for ; Thu, 18 Jan 2018 21:15:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 A320B815D3 for ; Thu, 18 Jan 2018 21:15:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-wm0-x229.google.com with SMTP id r78so25777110wme.0 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=KUlwr7l0SQIkg2uY8+uabXTyU3jmVOeZabLXObkBu1oEpD/atCyyIUfnH/E/QICHFZ N7rHvCSv0YbNIda1eNs/SAh/cpi4YTPl4kIttZsV6pBFDTdwqgk1EyjnfBb5dZdmPRx7 FjC8Mk51GmsvaANxiGfD/J7knnFaYFHHuoKRtD0Xmrmow2bu8rWTE4wnT8SFyRB7aec3 P5WNqQ7ztUar0MOrsVTgMFuGK9aBE0kMKiCaWspWIRfQ/BZ/ZnJ00lmTPCpmMfu4WVuj FzKBHjKV3tvaD7S1+erx7m/yKu8VWYwj6w+Sg13pYzgEf2iMcBYOb1SlgIHIDGqJwP13 yqpw== X-Gm-Message-State: AKwxytcICZXYIrKDormYi/Y3oME3geRAXZMN0DCqpkeUYycHgQgFFY4a twIelYtiOFGiXYzI7Y/5oi53/NeEs+AKfjDHoXuaGQ== 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-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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