Date: Wed, 20 Jan 1999 12:01:26 -0800 From: Julian Elischer <julian@whistle.com> To: "Jeroen C. van Gelderen" <gelderen@mediaport.org> Cc: Robert Nordier <rnordier@nordier.com>, Peter Wemm <peter@netplex.com.au>, fenner@parc.xerox.com, bde@zeta.org.au, cvs-committers@FreeBSD.ORG Subject: Re: -Werror Message-ID: <36A63615.4487EB71@whistle.com> References: <031a01be4495$52293240$0d79eb0a@deskfix.local>
next in thread | previous in thread | raw e-mail | index | archive | help
Jeroen C. van Gelderen wrote: > > From: Robert Nordier <rnordier@nordier.com> > >For example, compiled with -Wall, the code fragment > > > > if (x = y) > > x = z + 1 & 7; > > > >causes two warnings > > > > suggest parentheses around assignment used as truth value > > suggest parentheses around + or - in operand of & > > > >but rewriting to eliminate the errors would violate a style(9) > >guideline (unnecessary parentheses). > > Maybe you should consider updating style(9). A lot of companies would > consider parentheses in the last line absolutely neccessary. Chances are > that requiring parentheses in the first line will catch a few errors. > Chances that extra parentheses in the first line will *cause* errors are > quite small. Especially when you rewrite the line like: > if( (x = y) != 0 ) > which *IMHO* is the only correct way. > >[...] > > Fix style(9) and that problem goes away. certainly I've been pushing for stype(9) to allow more parentheses and more braces.. if() { } else { } sometimes makes implicit what the mind THINKS it sees but doesn't. > > A non-committer's view..., > Jeroen > -- > Jeroen C. van Gelderen -- gelderen@mediaport.org -- 0x46D8D3C8 -- &[8-D}~<= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36A63615.4487EB71>