From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1933 invoked from network); 24 Apr 1999 06:24:23 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?hswKjBuHwZRID9Fg0O9SkIUBIh08CNyF?@203.24.36.3) by ns1.primenet.com.au with SMTP; 24 Apr 1999 06:24:23 -0000 Received: (qmail 4846 invoked from network); 24 Apr 1999 04:38:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by 203.24.36.3 with SMTP; 24 Apr 1999 04:38:50 -0000 Received: (qmail 27540 invoked by alias); 24 Apr 1999 04:36:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6088 Received: (qmail 27531 invoked from network); 24 Apr 1999 04:36:22 -0000 From: "Bart Schaefer" Message-Id: <990423213208.ZM25952@candle.brasslantern.com> Date: Fri, 23 Apr 1999 21:32:08 -0700 In-Reply-To: <199904212352.QAA27713@bebop.clari.net> Comments: In reply to Wayne Davison "Re: Patch available for 3.0.6-pre-0" (Apr 21, 4:52pm) References: <199904212352.QAA27713@bebop.clari.net> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Wayne Davison Subject: Re: Patch available for 3.0.6-pre-0 Cc: zsh-workers@sunsite.auc.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 21, 4:52pm, Wayne Davison wrote: } Subject: Re: Patch available for 3.0.6-pre-0 } } Some of the added braces were to enclose some one-line macros that } consist of an "if ... else ..." block. This makes it look like some } of the ifs have braces that are enclosing only one line. Exactly what warning were you silencing in this case? The reason most of those macros look like #define thing() if (! testthing) {;} else dothing and *not* #define thing() if (testthing) dothing is to prevent ambiguous/erroneous "else" situations. My favorite approach is to write these kind of macros as #define thing() do { if (testthing) dothing; } while (0) because that forms a semicolon-terminable statement yet still wraps the macro body in braces. The PERMALLOC { ... } LASTALLOC; blocks make use of this trick, for example. However, a previous maintainer chose not to adopt that for macros that could be written as if (...) {;} else ..., so I'd like to have a clear reason for changing them. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com