From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,d055dd2f0172279a X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-18 12:08:20 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!news.sprintlink.net!EU.net!CERN.ch!news From: danpop@cernapo.cern.ch (Dan Pop) Subject: Re: Alpha compiler bug X-Nntp-Posting-Host: ues5.cern.ch Message-ID: Sender: news@news.cern.ch (USENET News System) Organization: CERN European Lab for Particle Physics References: <3houb5$8cr@vixen.cso.uiuc.edu> <3hqv3e$qb2@vixen.cso.uiuc.edu> Date: Sat, 18 Feb 1995 17:53:52 GMT In peter@nmti.com (Peter da Silva) writes: >In article <3hqv3e$qb2@vixen.cso.uiuc.edu>, >Steve Peltz 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