From owner-freebsd-current Wed Jan 27 19:04:40 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA26154 for freebsd-current-outgoing; Wed, 27 Jan 1999 19:04:40 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA26146 for ; Wed, 27 Jan 1999 19:04:38 -0800 (PST) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40356>; Thu, 28 Jan 1999 13:55:01 +1100 Date: Thu, 28 Jan 1999 14:04:20 +1100 From: Peter Jeremy Subject: Re: btokup() macro in sys/malloc.h To: current@FreeBSD.ORG Message-Id: <99Jan28.135501est.40356@border.alcanet.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: >:style(9) should emphasize legibility and maintainability, rather than >:minimizing the number of extraneous (from the compiler's perspective) >:parenthesis. > As far as parenthesis go, it's irrelevant because -Wall pretty much > covers the most common mistakes. I was thinking in terms of the parenthesis required as a result of the operator precedences (from K&R), rather than gcc -Wall. > If your code compiles without generating > a warning, your parenthesization is in good shape. Agreed. > Braces and indentation and other purely visual effects are a different > matter. Agreed. I think style(9) errs on the side of too few braces as well. My preference is for braces whenever you exceed 1 physical line rather than 1 statement. eg if (this && that) { foo(); } if (this) { if (that) a = b; else c = d; } Unfortunately (or maybe fortunately), gcc doesn't have an option to warn you that your indentation doesn't doesn't match its parsing. eg: if (a) if (b) foo(); else bar(); baz(); It would be nice if style(9) documented the options to give indent(1) to match the `approved' layout convections. (This would reduce the effort involved in importing large chunks of code). Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message