From owner-cvs-all Wed Jan 20 12:05:24 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA11404 for cvs-all-outgoing; Wed, 20 Jan 1999 12:05:24 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA11389 for ; Wed, 20 Jan 1999 12:05:20 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id MAA17389; Wed, 20 Jan 1999 12:01:31 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdj17382; Wed Jan 20 20:01:30 1999 Message-ID: <36A63615.4487EB71@whistle.com> Date: Wed, 20 Jan 1999 12:01:26 -0800 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2.7-RELEASE i386) MIME-Version: 1.0 To: "Jeroen C. van Gelderen" CC: Robert Nordier , Peter Wemm , fenner@parc.xerox.com, bde@zeta.org.au, cvs-committers@FreeBSD.ORG Subject: Re: -Werror References: <031a01be4495$52293240$0d79eb0a@deskfix.local> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Jeroen C. van Gelderen wrote: > > From: Robert Nordier > >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