http://d.puremagic.com/issues/show_bug.cgi?id=5930
Summary: cas doesn't work when used in code compiled with -D Product: D Version: D2 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: druntime AssignedTo: nob...@puremagic.com ReportedBy: jsan...@gmail.com --- Comment #0 from Jose Garcia <jsan...@gmail.com> 2011-05-05 12:03:54 PDT --- $ cat cas_test.d import core.atomic; import std.exception; import std.stdio; unittest { shared bool init = false; writefln("init = %s", init); enforce(cas(&init, false, true)); writefln("init = %s", init); } void main() {} $ dmd -unittest cas_test.d && ./cas_test init = false init = true $ dmd -unittest -D cas_test.d && ./cas_test init = false object.Exception@cas_test.d(9): Enforcement failed ---------------- ./cas_test(_D3std9exception7bailOutFAyaixAaZv+0x5b) [0x80a0dcb] ./cas_test(_D3std9exception45__T7enforceTbVAyaa10_6361735f746573742e64Vi9Z7enforceFbLAxaZb+0x2b) [0x80985ff] ./cas_test(_D8cas_test11__unittest1FZv+0x39) [0x80954dd] ./cas_test(_D8cas_test9__modtestFZv+0x8) [0x80987bc] ./cas_test(_D4core7runtime18runModuleUnitTestsUZb16__foreachbody247MFKPS6object10ModuleInfoZi+0x24) [0x80a3e1c] ./cas_test(_D6object10ModuleInfo7opApplyFMDFKPS6object10ModuleInfoZiZi+0x46) [0x809a872] ./cas_test(runModuleUnitTests+0x87) [0x80a3d37] ./cas_test(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x20) [0x809b718] ./cas_test(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20) [0x809b678] ./cas_test(main+0x94) [0x809b624] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x126e37] ./cas_test() [0x80953f1] ------------------------- Does this have to do with core/atomic.d having version(D_Doc) bool cas(...)(...) {return false; } ? The work around is not to use object files compiled with the -D flag! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------