Renaming all symbols in libmp(3)

David Schultz das at FreeBSD.ORG
Thu Feb 26 21:26:11 PST 2009


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. :-)


More information about the freebsd-hackers mailing list