Date: Tue, 16 Jun 2020 22:16:48 -0600 From: Warner Losh <imp@bsdimp.com> To: Ian Lepore <ian@freebsd.org> Cc: Kristof Provost <kp@freebsd.org>, Ed Maste <emaste@freebsd.org>, Toomas Soome <tsoome@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r362217 - head/stand/common Message-ID: <CANCZdfo=3RuZxt79XNajy2_c2m=LdJTsTMOwp7Cy5NAO7B-_qg@mail.gmail.com> In-Reply-To: <CANCZdfo0R6LDB_VVxO1rMxFkQ6ygCCFioWbiMoFJE0KL5hY46w@mail.gmail.com> References: <202006160705.05G753T4057972@repo.freebsd.org> <55903c38d363aef2a6f6d0075dd4526b86d51258.camel@freebsd.org> <CAPyFy2D1mhkxR00BGB1Ufn3PLRe%2Bb-t%2Bz_bgss=7am%2Bn3inWjw@mail.gmail.com> <E023EB92-0AC3-4AD8-A309-81AA6E07F80F@FreeBSD.org> <8948411d5bb0ab7ffae4c9cba06bda7b8943e0cd.camel@freebsd.org> <CANCZdfo0R6LDB_VVxO1rMxFkQ6ygCCFioWbiMoFJE0KL5hY46w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 16, 2020 at 9:53 PM Warner Losh <imp@bsdimp.com> wrote: > > > On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore <ian@freebsd.org> wrote: > >> On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote: >> > On 16 Jun 2020, at 19:11, Ed Maste wrote: >> > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore <ian@freebsd.org> wrote: >> > > > >> > > > 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). >> > > >> > > Perhaps it's time to update style(9) to at least permit these uses, = as >> > > we've done with the blank line at the beginning of functions with no >> > > local variables, and with braces around single-line bodies. >> > >> > We have 431 instances of `for (int i` in sys alone. It=E2=80=99s not s= o much a >> > question of allowing it as acknowledging reality at this point. >> > >> > Best regards, >> > Kristof >> >> Hmm, so we do. If you weed out sys/contrib, and device drivers >> contributed by vendors, the number is a lot smaller, but still big >> enough that we should just change the rules I think. >> > > We should definitely just change the rules. There's no point in > prohibiting it. Contributors have already voted with their feet > > diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 > index 4e801bbcbe70..fd23d573eb00 100644 > --- a/share/man/man9/style.9 > +++ b/share/man/man9/style.9 > @@ -592,8 +592,6 @@ not > Parts of a > .Ic for > loop may be left empty. > -Do not put declarations > -inside blocks unless the routine is unusually complicated. > .Bd -literal > for (; cnt < 15; cnt++) { > stmt1; > > Though the block doesn't start until { so int i; in the commit technicall= y > doesn't violate this rule. We violate it in dozens of other ways than thi= s. > Re-reading the thread, it seems there's a consensus to change. https://reviews.freebsd.org/D25312 > Warner > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfo=3RuZxt79XNajy2_c2m=LdJTsTMOwp7Cy5NAO7B-_qg>