svn commit: r327354 - head/sys/vm

Mark Millard marklmi26-fbsd at yahoo.com
Fri Jan 19 20:16:46 UTC 2018


Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net wrote on
Fri Jan 19 18:39:03 UTC 2018 (quoting style(9)):

> I think everyone glossed over:
> 
>      Parts of a for loop may be left empty.  Do not put declarations inside
>      blocks unless the routine is unusually complicated.
> 
> Perhaps that second sentence should be extracted into a paragraph of its own?
> This does sound very much like what you said that you do in another reply
> in this thread.

That is what I vaguely remember, now that I see it.

I'm not so worried about code generation by compilers for the
distinctions or the liveness tracking. I'm more worried about
my own efforts during an analysis of the source code.

When I have to analyze/study unfamiliar functions, the size of
the range of source code where various variables might have been
used can complicate things and increases the amount of analysis,
including checking for a lack of interference by other code than
turns out to be outside the "its live" scope. Closer
approximation to minimizing the range of text helps with my
doing a reliable analysis and lets a higher fraction of my
time be spent on other aspects.

In other words, it may take less for me to classify something as
"unusually complicated" compared to some other folks. Overall I
tend to like putting to use principles of locality when they
readily apply.

As for names repeated in nested scopes (the same name space),
even absent a language rule disallowing such, I support being
able to have all such examples reported as at least informational
messages of some kind, possibly even selectable as "desired
errors" in the sense of stopping compiles from generating
object files despite not violating the language's criteria.

===
Mark Millard
marklmi at yahoo.com
( markmi at dsl-only.net is
going away in 2018-Feb, late)



More information about the svn-src-head mailing list