From owner-freebsd-current Wed Jan 27 19:46:47 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA01806 for freebsd-current-outgoing; Wed, 27 Jan 1999 19:46:47 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA01794 for ; Wed, 27 Jan 1999 19:46:44 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id TAA26822; Wed, 27 Jan 1999 19:46:02 -0800 (PST) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma026813; Wed, 27 Jan 99 19:45:56 -0800 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id TAA04081; Wed, 27 Jan 1999 19:45:55 -0800 (PST) From: Archie Cobbs Message-Id: <199901280345.TAA04081@bubba.whistle.com> Subject: Re: btokup() macro in sys/malloc.h In-Reply-To: <199901280251.NAA23946@godzilla.zeta.org.au> from Bruce Evans at "Jan 28, 99 01:51:15 pm" To: bde@zeta.org.au (Bruce Evans) Date: Wed, 27 Jan 1999 19:45:55 -0800 (PST) Cc: wollman@khavrinen.lcs.mit.edu, current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bruce Evans writes: > >In fact, style(9) should say: > > > > If at all possible, your code should compile without warnings > > when the gcc -Wall flag is given. > > Avoiding warnings is more an engineering than a stylistic matter. > You turn on warnings to help avoid bugs that the compiler can find > easily. You ask everyone else to turn on warnings so that compiling > their sources with the same CFLAGS as your sources doesn't cause a > spew of warnings. Well said. Personally, it would take me twice as long to debug code without -Wall. > >As it stands now (and I QUOTE!) it says: > > > > Don't use parentheses unless they're required for precedence, or > > the statement is really confusing without them. > > > > a = b->c[0] + ~d == (e || f) || g && h ? i : j >> 1; > > > >That's ridiculous! > > I think it's trying to be funny. This makes it a bad example either > way. Perhaps its point is that complicated expressions can't be made > less confusing by adding parentheses. Guess I missed the joke then.. :-) You're right, some things are inherently complicated. I think line formatting is as importatn as parentheses, for example. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message