Date: Fri, 27 Feb 2009 00:28:21 -0500 From: David Schultz <das@FreeBSD.ORG> To: Christoph Mallon <christoph.mallon@gmx.de> Cc: Ed Schouten <ed@80386.nl>, hackers@FreeBSD.ORG Subject: Re: Renaming all symbols in libmp(3) Message-ID: <20090227052821.GA98527@zim.MIT.EDU> In-Reply-To: <49A7171D.1060401@gmx.de> References: <20090226180756.GX19161@hoeg.nl> <20090226204243.GA96251@zim.MIT.EDU> <49A70092.6030601@gmx.de> <20090226221403.GA96580@zim.MIT.EDU> <49A7171D.1060401@gmx.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 26, 2009, Christoph Mallon wrote: > David Schultz schrieb: > >As for gcc's math builtins, most of them are buggy. They fail to > >respect the dynamic rounding mode, fail to generate exceptions > >where appropriate, fail to respect FENV_ACCESS and other pragmas, > >etc. Also, the complex builtins use simplified formulas that don't > >get the right answers for complex numbers with inf/nan components. > >Try running some of the tests in tools/regression/lib/msun without > >-fno-builtin and see what happens ;-) > > pow() is just an example. > The compiler may do magic with any call which has semantics defined by > the C standard in a hosted environment. Okay, so first, the world doesn't revolve around the strictest possible interpretation of the C standard. For example, FreeBSD has an extension such that `printf("%s", NULL)' prints "(null)" instead of having undefined behavior. But gcc translates this into `puts(NULL)', which once again has undefined behavior. You can put on your lawyer hat and counter that the beloved standard doesn't guarantee that any such thing will work, but that's a very contrarian attitude; the bottom line is that it's a POLA violation, and the extension worked just fine for many years. Second, the problems with the math builtins I cited above violate even a strict interpretation of the C standard. Third, this is a digression, and this is the last I'm going to say about it. :-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090227052821.GA98527>