[phobos] Purity of C Math Functions

Robert Jacques sandford at jhu.edu
Sun Dec 5 20:35:05 PST 2010


On Sun, 05 Dec 2010 18:43:23 -0500, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:
> On Sunday 05 December 2010 08:55:54 David Simcha wrote:
>> I'm trying to test out Brad's 64 work and I can't compile Phobos because
>> in 64 mode std.math calls some C math functions declared in druntime w/o
>> purity, safety, etc. tags.  I now remember that this was one of the few
>> areas I meant to come back to when I was cleaning up 64 support in
>> Phobos, but I forgot about it.  Is it safe to assume that C
>> core.stdc.math functions are @safe pure nothrow?
>
> Shouldn't _all_ C function be considered nothrow? C doesn't have  
> exceptions, so
> C functions can't possibly throw.
>
> - Jonathan M Davis

The C abi is the lingua franca of programming languages: just because the  
ABI is C, doesn't mean you're not actually calling C++, Python, Java, etc  
code.


More information about the phobos mailing list