Bug 24690

Summary: duplication in style.9
Product: Documentation Reporter: Alex Kapranoff <alex>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alex Kapranoff 2001-01-28 08:00:01 UTC
	style.9 manpage recomends against declaring functions inside
	other functions two times.  Look:

STYLE(9)	       FreeBSD Kernel Developer's Manual	      STYLE(9)

NAME
     style - Kernel source file style guide
[skip]
     When declaring variables in functions declare them sorted by size, then
     in alphabetical order; multiple ones per line are okay.  Declaring func-
     tions inside functions is not recommended, since their linkage scope is
     always global.  If a line overflows reuse the type keyword.

     Be careful to not obfuscate the code by initializing variables in the
     declarations.  Use this feature only thoughtfully.  DO NOT use function
     calls in initializers!

	     struct foo one, *two;
	     double three;
	     int *four, five;
	     char *six, seven, eight, nine, ten, eleven, twelve;

	     four = myfunction();

     Do not declare functions inside other functions; ANSI C says that such
     declarations have file scope regardless of the nesting of the declara-
     tion.  Hiding file declarations in what appears to be a local scope is
     undesirable and will elicit complaints from a good compiler.
Comment 1 nik freebsd_committer freebsd_triage 2001-02-02 03:09:13 UTC
State Changed
From-To: open->closed

Committed, thanks.