]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Relax the rule against declaring variables in nested scopes and for
authorWarner Losh <imp@FreeBSD.org>
Thu, 16 Jul 2020 14:12:54 +0000 (14:12 +0000)
committerWarner Losh <imp@FreeBSD.org>
Thu, 16 Jul 2020 14:12:54 +0000 (14:12 +0000)
commit34a8e7368f3f00d4564b0b980871f73929d6b1ce
tree6535a08935d4b6c27850ca7db595966c7ea406ea
parent3ea3fbe685e0c7858c0bf5f4d29714b8fbbe69a1
Relax the rule against declaring variables in nested scopes and for
initializations.

Relax some overly perscriptive rules against declarations: they may be at the
start of any blocks, even if things aren't super complicated. Allow more
initializations (those that call simple functions, like accessor functions for
newbus are fine). Allow the common idiom of declaring the loop variable in a for
loop.

This tries to codify what common exceptions are today, as well as give
some guidance on when it's best to do these things.

Reviewed by: tsoome, kp, markm, allanjude, jiles, cem, rpokala
(earlier versions: seanc, melifaro, bapt, pjd, bz, pstef, arichards,
 jhibits, vangyzen, jmallet, ian, glebius, jhb, dab, adrian,
 sef, gnn)
Differential Revision: https://reviews.freebsd.org/D25312
share/man/man9/style.9