From owner-freebsd-standards Mon Feb 10 7: 7: 5 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9395E37B401 for ; Mon, 10 Feb 2003 07:07:04 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8FDE43FBF for ; Mon, 10 Feb 2003 07:07:03 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h1AF6mVA000484; Mon, 10 Feb 2003 07:06:48 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h1AF6hk1000483; Mon, 10 Feb 2003 07:06:43 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Mon, 10 Feb 2003 07:06:43 -0800 From: David Schultz To: Bruce Evans Cc: Dag-Erling Smorgrav , Lukas Ertl , standards@FreeBSD.ORG Subject: Re: C99 floating point macros Message-ID: <20030210150643.GA383@HAL9000.homeunix.com> Mail-Followup-To: Bruce Evans , Dag-Erling Smorgrav , Lukas Ertl , standards@FreeBSD.ORG References: <20030210020259.GA4103@HAL9000.homeunix.com> <20030210234147.B890-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030210234147.B890-100000@gamplex.bde.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Bruce Evans : > On Sun, 9 Feb 2003, David Schultz wrote: > > > Thus spake Dag-Erling Smorgrav : > > > David Schultz 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