Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: danpop@cernapo.cern.ch (Dan Pop)
Subject: Re: Alpha compiler bug
Date: Sat, 18 Feb 1995 17:53:52 GMT	[thread overview]
Message-ID: <D47J1s.MtE@news.cern.ch> (raw)
In-Reply-To: id.D8EH1.K7K@nmti.com

In <id.D8EH1.K7K@nmti.com> peter@nmti.com (Peter da Silva) writes:

>In article <3hqv3e$qb2@vixen.cso.uiuc.edu>,
>Steve Peltz <peltz@cerl.uiuc.edu> wrote:
>
>> This is actually
>> a macro expansion, where in the general case it needs to look like a single
>> expression (it might be a macro expansion, or it might be a function call).
>
>It is considered bad form to pass an expression with a side effect to a macro.

It's considered even worse form to write macros that evaluate their
arguments more than once.  ANSI/ISO C requires that any macro defined
in a standard header (an implementation is allowed to provide macro
replacements for any standard function, provided that the function is
available in the standard library, too) evaluates its arguments only once.
Two exceptions: getc and putc (only the second argument of putc may be
evaluated more than once)

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@cernapo.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland


  reply	other threads:[~1995-02-18 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3houb5$8cr@vixen.cso.uiuc.edu>
1995-02-14  8:01 ` Alpha compiler bug David Gelhar
1995-02-15  9:57   ` Ronald F. Guilmette
1995-02-14 14:21 ` Stefan Monnier
1995-02-14 17:15 ` Peter da Silva
1995-02-14 19:08   ` Steve Peltz
1995-02-16 17:50     ` Peter da Silva
1995-02-18 17:53       ` Dan Pop [this message]
1995-02-14 19:45 ` Dave Hill
1995-02-21 17:37   ` HP LJ4M on OSF/3 Tadhg McCarthy
1995-02-21 17:41   ` PCL files on a HP4M printer Tadhg McCarthy
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox