NetBSD-Docs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Style guide function variable initialization?
Hi!
Near the beginning of the "function" function in the NetBSD source code
style guide
https://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&content-type=text/x-cvsweb-markup
it says the following:
Avoid initializing variables in the declarations; move
declarations next to their first use, and initialize
opportunistically. This avoids over-initialization and
accidental bugs caused by declaration reordering.
Is that a typo in the first sentence; should "move declarations" be
"move initializations"? I ask because all of the example functions in
the style guide seem to have the variable declarations at the beginning
of the function, not next to their first use.
Thanks!
Lewis
Home |
Main Index |
Thread Index |
Old Index