From owner-freebsd-hackers Fri Jun 30 5:29:54 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from penguin.wise.edt.ericsson.se (penguin-ext.wise.edt.ericsson.se [194.237.142.110]) by hub.freebsd.org (Postfix) with ESMTP id 848B837C500 for ; Fri, 30 Jun 2000 05:29:46 -0700 (PDT) (envelope-from uabfra@uab.ericsson.se) Received: from ms.uab.ericsson.se (ms.uab.ericsson.se [134.138.201.16]) by penguin.wise.edt.ericsson.se (8.10.1/8.10.1/WIREfire-1.9) with ESMTP id e5UCThs16632; Fri, 30 Jun 2000 14:29:43 +0200 (MET DST) Received: from uab.ericsson.se (ulinpc01 [134.138.184.201]) by ms.uab.ericsson.se (8.10.0/8.10.0/uab-2.26) with ESMTP id e5UCTZT07909; Fri, 30 Jun 2000 14:29:35 +0200 (MET DST) Message-ID: <395C92AF.302B9939@uab.ericsson.se> Date: Fri, 30 Jun 2000 14:29:35 +0200 From: Anders Franzen X-Mailer: Mozilla 4.72 [en] (X11; I; FreeBSD 4.0-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Martin Horcicka Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: style(9) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Martin Horcicka wrote: > Hi, > > I'm just reading the style(9) man page and I don't understand to two > rules: > > 1. Citation: > ============ > The kernel has a name associated with parameter types, e.g., in the kernel > use: > > void function(int fd); > > In header files visible to user land applications, prototypes that are > visible must use either protected names or no names with the types. It is > preferable to use protected names. e.g., use: > > void function(int); > > or: > > void function(int _fd); > ============ > Why is that necessary? IMHO, I would guess that it can prevent userland from typedefing own types. I.e. If a program makes an own type : typedef int fd: and then includes a header file saying : void function(int fd): the compiler would complain about the the type fd. /Anders Franzen > > > 2. Citation: > ============ > Indentation is an 8 character tab. Second level indents are four spaces. > > while (cnt < 20) > z = a + really + long + statement + that + needs + > two lines + gets + indented + four + spaces + > on + the + second + and + subsequent + lines. > ============ > a. What does it mean `second level indents'? Is it the indentation of > expressions that cannot fit to one line (as in the example above) or > is it any indentation except of the first tab? > > b. Aren't 8 characters too many? > > Martin > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message