From owner-cvs-all Wed Jan 20 08:54:09 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA20341 for cvs-all-outgoing; Wed, 20 Jan 1999 08:54:09 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from schuimpje.snt.utwente.nl (schuimpje.snt.utwente.nl [130.89.238.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA20335 for ; Wed, 20 Jan 1999 08:54:06 -0800 (PST) (envelope-from gelderen@mediaport.org) Received: from wit395301.student.utwente.nl ([130.89.235.121]:11015 "HELO deskfix" ident: "NO-IDENT-SERVICE[2]") by schuimpje.snt.utwente.nl with SMTP id <8095-10507>; Wed, 20 Jan 1999 17:53:37 +0100 Message-ID: <031a01be4495$52293240$0d79eb0a@deskfix.local> From: "Jeroen C. van Gelderen" To: "Robert Nordier" , "Peter Wemm" Cc: , , Subject: Re: -Werror Date: Wed, 20 Jan 1999 17:52:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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. >There's an awful lot of BSD >code like this, that could cause huge {Net,Open}BSD diffs if >rewritten. Hmm, but I thought the other BSD(s?) used -Werror? That would reverse your argument ;) >So (to give just one example) if -Werror if used, -Wall becomes >problematic. And so -Werror may result in useful warnings getting >turned off rather than on. Fix style(9) and that problem goes away. 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