From owner-freebsd-hackers Fri Jun 30 8:50:35 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 6CEAB37B7F6 for ; Fri, 30 Jun 2000 08:50:31 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id JAA91134; Fri, 30 Jun 2000 09:50:29 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id JAA41895; Fri, 30 Jun 2000 09:50:27 -0600 (MDT) Message-Id: <200006301550.JAA41895@harmony.village.org> To: Martin Horcicka Subject: Re: style(9) Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Fri, 30 Jun 2000 11:38:36 +0200." References: Date: Fri, 30 Jun 2000 09:50:27 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Martin Horcicka writes: : 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? Because the user is free to do this: #define fd Something Bad #include : 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? Yes. Second level indents are continued lines. : b. Aren't 8 characters too many? Don't get us going. No, it isn't. If you run out of room, GW says you are almost certainly doing something wrong. Besides, 8 is the official tab width size, so it makes it really easy for anybody with any editor to get the indentation right. It is also tradition and most of the code is written that way. I personally like 4 myself, but let's not get into a stupid tab width war were people argue about values from 2 to 6 that ends in the resolution that 8 might not be right, but reformatting everything would suck too bad to change it and introducing new code that isn't formatted at 8 would be confusing. OK? We've done that before. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message