Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jan 2014 15:34:17 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: libm lacks C99 functions -> no c++11 cmath in libstdc++
Message-ID:  <20140129233417.GA90062@troutmask.apl.washington.edu>
In-Reply-To: <20140129222325.GA9806@hades.panopticon>
References:  <20140129164136.GA3489@hades.panopticon> <20140129172307.GA88757@troutmask.apl.washington.edu> <20140129184735.GA63095@hades.panopticon> <20140129215928.GA89714@troutmask.apl.washington.edu> <20140129222325.GA9806@hades.panopticon>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 30, 2014 at 02:23:25AM +0400, Dmitry Marakasov wrote:
> * Steve Kargl (sgk@troutmask.apl.washington.edu) wrote:
> 
> > > > > - bad enough by itself, it affects libstdc++ from ports' gcc in such a
> > > > >   way that it disables C++11 math completely (along with a lot more
> > > > >   other more widely used math functions)
> > > > >
> > > > >
> > > > > - we may probably implement these by calling less-precise
> > > > >   erf erfc lgamma tgamma as we do with other functions as we alredy
> > > > >   do with some others
> > > > 
> > > > This, unfortuantely, has already been done, although it may only 
> > > > be available in FreeBSD-current.  See src/lib/msun/src/imprecise.c.
> > > 
> > > I know, it's available on 10.0 as well. However that's not the case for
> > > 9.x, for which it's impossible to build c++11 math using software (even
> > > if it doesn't use unimplemented functions), neither with system gcc
> > > nor with gcc from ports.
> > > 
> > 
> > It's not impossible.  Add whatever C++-fu you need
> > that is equivalent to
> > 
> > #include <math.h>
> > #ifndef fool
> > #define fool(x)	foo((double)(x))
> > #endif
> 
> The point was that one should not be required to do something like this
> to build std::hypot - using software on FreeBSD.
> 

My point is that specifically adding this #define
kludge to whatever software needs it is preferrable to
the travesty foisted on libm by msun/src/imprecise.c.
What imprecise.c does is not documented.

-- 
steve



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