🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2428

Re: Macros and Braces

#2428
From: J. Kanze
Date: Thu, 28 Mar 1996 12:48
26 lines
1620 bytes
In article <4jcklt$9uj@solutions.solon.com> watzka@stat.uni-muenchen.de
(Kurt Watzka) writes:

|> 100576.1776@compuserve.com (Antony Pace (UK/CH)) writes:

|> >I wrote:

|> >>> I am having problems writing a macro (Ansi C) for which I feel there
|> >must be standard technique.  Can anyone help? <<

|> >Many thanks to everyone who emailed me the standard technique of the do
|> >{...} while(1) structure.  This is exactly what I needed.  I didn't
|> >expect such a generous response and will look out for the FAQ.

|> I would avoid using "do { ... } while(1)" as a wrapper for "function like
|> macros". It might lead to unexpected results. :-)

At the very least, I would expect the program to run slower that if the
macro were terminated by "while(0)":-).  (Who was it that reported that
the latest Cray is so fast, it only takes ten minutes for an endless
loop?)
-- 
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle --
                            -- Beratung in industrieller Datenverarbeitung
Technical Details
Message-ID: <4je1q2$g39@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: OUI256@USER.COM <4ja3sd$pb9@solutions.solon.com> <4jcklt$9uj@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.lang.c.moderated
Subject: Re: Macros and Braces
Date: 28 Mar 1996 06:48:02 -0600
Organization: GABI Software, Sarl.
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4je1q2$g39@solutions.solon.com>
References: OUI256@USER.COM <4ja3sd$pb9@solutions.solon.com>
 <4jcklt$9uj@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com