svn commit: r231834 - head/share/mk

Bruce Evans brde at optusnet.com.au
Fri Feb 17 06:12:36 UTC 2012


On Thu, 16 Feb 2012, Warner Losh wrote:

> Log:
>  Fix comma splice, can't ambiguity and quoting.
>
>  Submitted by:	bde@
>  MFC after:	2 weeks

Thanks, but this introduces 3 of 4 new style bugs:

> Modified: head/share/mk/bsd.kmod.mk
> ==============================================================================
> --- head/share/mk/bsd.kmod.mk	Thu Feb 16 19:40:17 2012	(r231833)
> +++ head/share/mk/bsd.kmod.mk	Thu Feb 16 21:04:47 2012	(r231834)
> @@ -9,7 +9,7 @@ SYSDIR=	${_dir}
> .endfor
> .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
>     !exists(${SYSDIR}/conf/kmod.mk)
> -.error "can't locate the kernel source tree, set SYSDIR to override."
> +.error Unable to locate the kernel source tree. Set SYSDIR to override.
> .endif

1. I think I asked for more quoting, not less.
2. Error messages are not capitalized in KNF.  The existing error messages
    in *.mk don't provide good examples of following this rule, since they
    mostly begin with a proper name with its normal case.
3. Sentence breaks are 2 spaces in KNF.  This is also the rule in gnu
    sources.  It is a good rule.  More than 95% of sentence breaks in
    gcc/*.c  follow it.  gnu even requires 2 spaces after '.' before
    '*/', which made it unnecessary for me to write complicated regexps
    to check for comformance to the rule in gcc.  In the 1996 version
    of gnu standards.text, it is explained that this is so that the Emacs
    sentence commands will work.  Apparently, Emacs is too small for
    unsimple regexps :-).  gnu standards.text the rules in much more
    detail than style(9) (or this mail).  Even in 1996, it was about
    5 times larger than style(9) is now.
4. The rule in (2) is not so good for multiple sentences, but error messages
    should be single sentences unless they are very long or complicated, but
    they shouldn't be very long or complicated either.  The rule in (3) is
    null for single sentences in error messages and comments, so code that
    would otherwise break it is saved by only using single sentences.
5. I think I asked for following the rule for not terminating error
    messages, but it is consistently not followed in *.mk.  gnu style
    requires complete sentences, (and thus normal capitalization and
    punctuation) more forcefully than KNF.

Bruce


More information about the svn-src-all mailing list