Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2003 07:06:43 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, Lukas Ertl <l.ertl@univie.ac.at>, standards@FreeBSD.ORG
Subject:   Re: C99 floating point macros
Message-ID:  <20030210150643.GA383@HAL9000.homeunix.com>
In-Reply-To: <20030210234147.B890-100000@gamplex.bde.org>
References:  <20030210020259.GA4103@HAL9000.homeunix.com> <20030210234147.B890-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Bruce Evans <bde@zeta.org.au>:
> On Sun, 9 Feb 2003, David Schultz wrote:
> 
> > Thus spake Dag-Erling Smorgrav <des@ofug.org>:
> > > David Schultz <dschultz@uclink.Berkeley.EDU> writes:
> > > > Hmm...why not just use some macros, like this?
> > >
> > > Macros behave strangely when invoked with arguments which have side
> > > effects.
> 
> This would be a programmer error, since these interfaces are specified
> to be macros.
> 
> > Doh!  I should have seen that.  I'll wrap them in a do...while(0)
> > with a local variable.  Thanks for the catch!
> 
> I thought that you saw it.

Bah, I did when I wrote them.  Then I had a knee-jerk reaction to
des's complaint and forgot.  You *can't* actually get it right if
you want the routines to be function-like as described in section
7.1.4 of the C99 standard.  In order to do so, you would be required
to provide a function prototype in addition to the macro, and you
can't do that for the overloaded floating-point classification macros.

\me sulks off to the corner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030210150643.GA383>