Subject: KNF and braces (was: Re: EGCS 1.1 UPDATE rev. 4)
To: Todd Vierling <tv@pobox.com>
From: Chris G. Demetriou <cgd@netbsd.org>
List: tech-toolchain
Date: 08/18/1998 11:05:32
Todd Vierling <tv@pobox.com> writes:
> - egcs issues warnings about "ambiguous braces" that is supposedly against
>   KNF (I haven't checked thoroughly).  Use "CFLAGS+=-Wno-parentheses" in
>   /etc/mk.conf to override this behavior.  This may be removed from the
>   set of warnings issued by "-Wall".

So, for the rest of you (who may not know), KNF says:

"No braces are used for control statements with zero or only a single
statement."

e.g.:

        for (;;)
                stmt;


I think there's a pretty good argument to be had that it's good
programming practice to put in the braces anyway, and it's what I
do and have advocated for a while (see sys/arch/alpha/STYLE 8-).


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.
Plug: Get your official NetBSD-1.3.2 CDROM set today! http://www.netbsd.com/