Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 2003 00:54:59 -0800
From:      David Schultz <das@FreeBSD.ORG>
To:        Tim Robbins <tjr@FreeBSD.ORG>
Cc:        Kris Kennaway <kris@obsecurity.org>, current@FreeBSD.ORG
Subject:   Re: Port breakage (isnan undeclared)
Message-ID:  <20030321085459.GA10003@HAL9000.homeunix.com>
In-Reply-To: <20030320202706.A35844@dilbert.robbins.dropbear.id.au>
References:  <20030320085522.GA13634@rot13.obsecurity.org> <20030320202706.A35844@dilbert.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Tim Robbins <tjr@FreeBSD.ORG>:
> On Thu, Mar 20, 2003 at 12:55:22AM -0800, Kris Kennaway wrote:
> 
> > Several ports have become broken recently with the following error:
> > 
> > ../../../include/osg/Math:149: `isnan' undeclared (first use this function)
> > 
> > http://bento.freebsd.org/errorlogs/i386-5-latest/osg-0.9.3.log
> > http://bento.freebsd.org/errorlogs/i386-5-latest/gnucap-0.31.log
> > http://bento.freebsd.org/errorlogs/i386-5-latest/fractorama-1.6.4.log
> > 
> > Can someone please investigate?
> 
> The prototypes for isnan() &c. need to be put back into math.h, and their
> source files need to be un-deprecated.

C99 requires that isnan() be a macro, since it can take arguments
of multiple types and C doesn't support templates or overloading.
Technically, redundant function and macro implementations can
coexist, but that's gross.

A better solution may be to define _GLIBCPP_USE_C99 to 1 in
libstdc++.  Among other things, this tells the C++ library to
capture standard C99 macros such as isnan() in a wrapper in the
std namespace before undefing them as it does now.  The
appropriate configure option is --enable-c99, BTW.  If a real C++
guru could make sure this doesn't break anything else I would be
grateful.  What I don't understand is why the libstdc++
all-your-macros-are-belong-to-us magic gets pulled in when you say
'#include <math.h>' instead of <cmath>.  That's going to break
programs (such as fractorama) that expect isnan() and friends to
be in the global namespace.  Again, comments from someone with C++
fu would be appreciated.

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




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