Date: Mon, 10 Jan 2005 05:02:05 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Warner Losh <imp@rover.village.org> Cc: jhb@freebsd.org Subject: Re: cvs commit: src/share/man/man9 style.9 Message-ID: <20050110042202.Q29420@delplex.bde.org> In-Reply-To: <20050105.141439.74745436.imp@harmony.village.org> References: <200501051916.j05JG1iH029185@repoman.freebsd.org> <20050105.141439.74745436.imp@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 5 Jan 2005, Warner Losh wrote: [Warner Losh didn't write] > > I thought the reason for the - is that it prevented indent(1) from trying to > > reindent that comment block and thus there might be comment blocks with a > > leading '/*-' that aren't copyrights. > > There might be, yes, and I've added a note to style(9) in my tree > explaining that. In a quick straw poll of the source tree, I found no > comments starting in column 1 that weren't a license statement. Comments starting in column 1 and also in line 1? Indent protection is used for much more than copyrights, so /*- doesn't give a hint that the comment might be a copyright except near line 1. > That's true that's what the /*- is for, but if any come to light, you > can change it to /** just as easily. "/**" also means indent protection. Gnu indent's man page claims to also treat comments beginning with "/*=" and "/*_", and even normal block comments, as being box comments and thus automatically protected from indent. Apart from a better default, gnu indent's handling of block comments seems to be worse than FreeBSD's. gnu indentntly always treats block comments as box comments and thus doesn't reformat them, while FreeBSD defaults to reformatting them but has -fcb and -nfcb options to control their formatting. I added these options because reformatting of block comments is usually not wanted but is sometimes useful. BTW, in at least FreeBSD indent, there are other strange magic characters after "/*". A block comment is defined as a comment with a newline immediately after the "/*-". Whitespace between the "/*" and the newline breaks the blockness of a comment. This causes some intended-as-block comments with trailing whitespace after "/*" to be reformatted despite -nfcb. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050110042202.Q29420>