From owner-svn-src-all@freebsd.org Wed Jun 17 02:39:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA00B33FCA9 for ; Wed, 17 Jun 2020 02:39:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49mq642hrpz48K4 for ; Wed, 17 Jun 2020 02:39:40 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1592361579; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=sRRyoPHlwv/cq+tq/KXysJLqcXO5mq2Y0DWofFiLDPQACq445ZZO0hnRh/uGWifyQjAVlCfGgd7Kj W+I1ywdO7aHx1+nwYgQ01gHzYIelgCUl7qt3sycsZcXtbXFCPe+qrsSYKcrN+NdfV+QueM73owS+lZ iYwLTAktboweuzYZBE0Z4T3j8Qs7t68btwAcIM5i5Ad1Uh3ZSjzCjsUAXtyH1KDWH31RfNrLMHnF1b 05fJXC8FNZzpV3vaCmlRSdVybzwiw/RDpqgPFQXz+ztk8Ji+w7k/RWGumxkzOhCwnIGbCWpMcat4FW +vYLTGklyo6QmpAyvboTvbdG/7CCaRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=413L/30VUu8RfhaLwbW45QL8tptFqBIxv/TlAtoGqvc=; b=rgr9LEtDIouA9IX7FYluNGXYH1Lz0mHRc3JHtTuVBzAbnJ0A7F4M6nN8Q/3nfXlvhrY8911kfnY2j vIjwMcbldEzNlroZAWN/vAyRwK5PbL4vpuOyr+fDHoOHSP8dxehbHA2uU5bL9M46AzNm2Ve8mp2sAI ZYbpLuHhvqHSl5lAoXaG+pfHTJErvSZnRCy39BbwSKTtBxxWTroh9CY/O3htMwTfdHYlGfhLkeNa5a LcxNrnKy2x+Om6vzfXUYDc4DLFWONPfwICW+AY9/QGeQDGgxRifwjq27sGKCrM57G0Bh/KSnKKfFuj EUg10SE1O0h4dW90iSGiGAGOy628tjQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=413L/30VUu8RfhaLwbW45QL8tptFqBIxv/TlAtoGqvc=; b=m90L8tOA40RZfQlPYAUQRZP7CeKz86rR3TCB3q13Jup0aMsddCHs1k18Fzq+HmIrrGGwBqhHfr55B CxmoP/AzZEX/rHeR9BtH0gEBt3JvrKMHyYJ4BbVKYTgPzVyc/8MUKag8XITh4I8vrAC8QAYhg8IYL+ ihAQp8WJx4F2AZps5lNIYDrwFj8Pa9+xU+JsafEAXAsepQ1wMUbEbMjk5r4Wuw3+pPPTvz0gftIM04 HsERsElyMNkGhIng072rTOZdDX+LAK/RtLUWD0GIdOjCgz6x+j5FiBYzaagg6ug4Z3sZX2qF7Y86Ux XxSTjduPyjRp/0cXIRh/Okm5ZY+j7xg== X-MHO-RoutePath: aGlwcGll X-MHO-User: c8bbdc3f-b043-11ea-a067-6d02e42e573a X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c8bbdc3f-b043-11ea-a067-6d02e42e573a; Wed, 17 Jun 2020 02:39:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 05H2daah027683; Tue, 16 Jun 2020 20:39:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <337eaa72d621d514583c776f70d4a3d1c4a7cf83.camel@freebsd.org> Subject: Re: svn commit: r362217 - head/stand/common From: Ian Lepore To: rgrimes@freebsd.org, Cy Schubert Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 16 Jun 2020 20:39:36 -0600 In-Reply-To: <202006161730.05GHUc9B082017@gndrsh.dnsmgr.net> References: <202006161730.05GHUc9B082017@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49mq642hrpz48K4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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, 17 Jun 2020 02:39:40 -0000 On Tue, 2020-06-16 at 10:30 -0700, Rodney W. Grimes wrote: > > In message < > > 55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org>, > > Ian Le > > pore writes: > > > On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote: > > > > Author: tsoome > > > > Date: Tue Jun 16 07:05:03 2020 > > > > New Revision: 362217 > > > > URL: https://svnweb.freebsd.org/changeset/base/362217 > > > > > > > > Log: > > > > loader: variable i is unused without MBR/GPT support built in > > > > > > > > Because i is only used as index in for loop, declare it in > > > > for > > > > statement. > > > > > > > > > > As much as I prefer doing it this way, style(9) doesn't allow for > > > variable declarations inside a for() statement (or even inside a > > > local > > > block, which is just too 1980s for me, but it is still our > > > standard). > > Last time I tried to assert that bit of style(9) with respect to > inside a local block I was over ridden, so it is probably time > to atleast revisit that part of style(9). > > > Doesn't this use stack for a shorter period of time or does the > > compiler > > optimize this, making this change moot? > > > > The tradeoff is a few extra bytes of stack for a longer period of > > time vs a > > few extra instructions incrementing and decrementing the stack > > pointer. > > I do not think the reasoning had to do with stack space vs > instuctions, > but more about being able to clearly know about variable reuse and > not > do it as that can create fun bugs. > > Tools have modernized since that part of style was written. I think a modern compiler will likely emit one of those "declaration of foo here shadows declaration in outer scope" type messages. Not that it should; IMO, part of the point of keeping definitions confined to as local a scope as possible is to help ensure you're using the variable you think you are in that local scope and not accidentally perturbing something used elsewhere. -- Ian