Date: Fri, 30 Jun 2000 09:50:27 -0600 From: Warner Losh <imp@village.org> To: Martin Horcicka <horcicka@dzungle.ms.mff.cuni.cz> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: style(9) Message-ID: <200006301550.JAA41895@harmony.village.org> In-Reply-To: Your message of "Fri, 30 Jun 2000 11:38:36 %2B0200." <Pine.BSF.3.96.1000630113615.2357A-100000@dzungle.ms.mff.cuni.cz> References: <Pine.BSF.3.96.1000630113615.2357A-100000@dzungle.ms.mff.cuni.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.3.96.1000630113615.2357A-100000@dzungle.ms.mff.cuni.cz> 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 <sys/header.h> : 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006301550.JAA41895>