From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Wayne Davison <wayne@clari.net>
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: Patch available for 3.0.6-pre-0
Date: Fri, 23 Apr 1999 21:32:08 -0700 [thread overview]
Message-ID: <990423213208.ZM25952@candle.brasslantern.com> (raw)
In-Reply-To: <199904212352.QAA27713@bebop.clari.net>
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
next prev parent reply other threads:[~1999-04-24 6:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-21 8:15 Bart Schaefer
1999-04-21 8:47 ` Peter Stephenson
1999-04-21 14:14 ` Tatsuo Furukawa
1999-04-21 16:05 ` Bart Schaefer
1999-04-22 15:07 ` Tatsuo Furukawa
1999-04-24 5:53 ` Bart Schaefer
1999-04-25 6:57 ` Geoff Wing
1999-04-26 15:22 ` Tatsuo Furukawa
1999-04-27 16:24 ` Bart Schaefer
1999-04-21 23:52 ` Wayne Davison
1999-04-24 4:32 ` Bart Schaefer [this message]
1999-04-24 7:12 ` Wayne Davison
1999-04-23 12:48 Sven Wischnowsky
1999-04-23 14:13 Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=990423213208.ZM25952@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=wayne@clari.net \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).