From owner-cvs-all Tue Sep 10 7:24:32 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5069437B400; Tue, 10 Sep 2002 07:24:25 -0700 (PDT) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E59943E3B; Tue, 10 Sep 2002 07:24:23 -0700 (PDT) (envelope-from brandt@fokus.gmd.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id g8AEOLh02557; Tue, 10 Sep 2002 16:24:21 +0200 (MEST) Date: Tue, 10 Sep 2002 16:24:21 +0200 (CEST) From: Harti Brandt To: Juli Mallett Cc: Tony Finch , , Subject: Re: cvs commit: src/share/man/man9 style.9 In-Reply-To: <20020910071126.B44916@FreeBSD.org> Message-ID: <20020910161928.E64100-100000@beagle.fokus.gmd.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 10 Sep 2002, Juli Mallett wrote: JM>* De: Tony Finch [ Data: 2002-09-10 ] JM> [ Subjecte: cvs commit: src/share/man/man9 style.9 ] JM>> fanf 2002/09/10 03:54:40 PDT JM>> JM>> Modified files: JM>> share/man/man9 style.9 JM>> Log: JM>> Remove a sentence about wrapping macro definitions in bare braces, JM>> which became wrong after using do { } while (0) became recommended. JM>> Move the definition of what braces are to their new first occurrence. JM>> JM>> Reviewed by: bde JM> JM>Any chance of us adopting the Mach (and Lites) policy of doing JM> (actually ), and having some JM>macros like JM> JM>#define MACRO_BEGIN do { JM>#define MACRO_END } while(0) /* or with a ; if you like that */ JM> JM>? JM> JM>IMHO this actually reduces the amount of obfuscation, because it makes JM>it clear what the statements are actually there to accomplish, and JM>keeps the braces from running into/obfuscating braces with meaning. Have a look at the original v7 sh sources and you see that this kind of stuff actually adds obfuscation. If you use these defines every day, you know what they stand for, if you don't you have to lookup the definition each time you see such a define used. This makes reading code a lot harder. Adding a ; to MACRO_END would be a bad idea, if a macro defined with MACRO_END would be used in an if() statement without braces. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.gmd.de, brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message