Index: style.9 =================================================================== RCS file: /home/ncvs/src/share/man/man9/style.9,v retrieving revision 1.93 diff -u -r1.93 style.9 --- style.9 10 Sep 2002 14:48:38 -0000 1.93 +++ style.9 17 Oct 2002 16:40:05 -0000 @@ -180,6 +180,47 @@ } while (0) .Ed .Pp +When code blocks are conditionally defined using +.Ic #ifdef +or +.Ic #if , +a comment may be added following the matching +.Ic #endif +or +.Ic #else +to permit the reader to easily discern where conditionally defined code +regions end. +This comment should be used only for (subjectively) long regions, regions +greater than 20 lines, or where a series of nested +.Ic #ifdef 's +may be confusing to the reader. +Exceptions may be made for cases where code is contionally undefined for +the purposes of lint, even though the undefined region may be small. +The comment shall be seperated from the +.Ic #endif +or +.Ic #else +by a single space. +For short conditionally defined regions, a closing comment should not be +used. +.Bd -literal +#ifdef KTRACE +#include +#endif + +#ifdef COMPAT_43 +/* A long block here, or other conditional code. */ +#else /* COMPAT_43 */ +/* Or here. */ +#endif /* COMPAT_43 */ + +#ifndef COMPAT_43 +/* Yet another long block here, or other conditional code. */ +#else /* !COMPAT_43 */ +/* Or here. */ +#endif /* !COMPAT_43*/ +.Ed +.Pp Enumeration values are all uppercase. .Bd -literal enum enumtype { ONE, TWO } et;