Bug 4220 – I cannot apply @safe to intrinsic operation(eg: std.math.sqrt)
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-05-22T19:27:00Z
Last change time
2014-02-15T02:42:34Z
Assigned to
nobody
Creator
zan77137
Comments
Comment #0 by zan77137 — 2010-05-22T19:27:36Z
I try to apply @safe/@trusted/@system to Phobos
See also http://lists.puremagic.com/pipermail/phobos/2010-May/000488.html
I found this issue there.
This issue causes mangling that had been influenced by @safe/@trusted.
dmd converts a specific symbol into intrinsic operation. However, dmd cannot convert symbols that are marked by @safe/@trusted.
I am skeptical about the influence on mangling rule by @safe.
It may be related to overload, but I think that overload is unnecessary.
Comment #1 by bugzilla — 2010-05-23T21:23:26Z
changeset 499
(also requires new std.math)
Comment #2 by bugzilla — 2010-05-23T21:26:31Z
Requires the following changes to std.math:
317c317
< pure nothrow real cos(real x); /* intrinsic */
---
> @safe pure nothrow real cos(real x); /* intrinsic */
332c332
< pure nothrow real sin(real x); /* intrinsic */
---
> @safe pure nothrow real sin(real x); /* intrinsic */
397c397
< pure nothrow real tan(real x)
---
> @trusted pure nothrow real tan(real x)
808c808
< pure nothrow long rndtol(real x); /* intrinsic */
---
> @safe pure nothrow long rndtol(real x); /* intrinsic */
830c830
< pure nothrow
---
> @safe pure nothrow
1388c1388
< pure nothrow real ldexp(real n, int exp); /* intrinsic */
---
> @safe pure nothrow real ldexp(real n, int exp); /* intrinsic */
1582c1582
< pure nothrow real fabs(real x); /* intrinsic */
---
> @safe pure nothrow real fabs(real x); /* intrinsic */
1781c1781
< pure nothrow real rint(real x); /* intrinsic */
---
> @safe pure nothrow real rint(real x); /* intrinsic */
3610,3611c3610,3611
< pure nothrow real yl2x(real x, real y); // y * log2(x)
< pure nothrow real yl2xp1(real x, real y); // y * log2(x + 1)
---
> @safe pure nothrow real yl2x(real x, real y); // y * log2(x)
> @safe pure nothrow real yl2xp1(real x, real y); // y * log2(x + 1)