[Issue 5305] intrinsic functions have @safe stripped of them in release mode.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 20 12:33:26 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5305
--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> 2012-01-20 12:33:25 PST ---
A reduced test case:
import std.math;
void map(real function(real) f) { }
void main() { map(&sqrt); }
What is happening here is that sqrt() is an intrinsic, it doesn't actually
exist in the libphobos2.a. When compiled with -release, the assert() goes away,
and sqrt is never referenced, hence no error.
Without -release, the linker looks for std.math.sqrt, and can't find it because
it's an intrinsic.
The solution is one of:
1. have the compiler complain about attempts to take the address of an
intrinsic
2. add a library version of the intrinsic
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list