http://bugzilla.gdcproject.org/show_bug.cgi?id=8
--- Comment #6 from Johannes Pfau <johannesp...@gmail.com> 2014-02-13 08:17:33 GMT --- Iain, do you want to look into this again? I read some of the old discussions and the dlang.org pull request and to summarize: * All functions should be evaluated LTR, even extern(C) * Array OPs expect extern(C) functions to be evaluated RTL * DMD backend does extern(C) functions RTL So in order to fix this, we'd have to evaluate extern(C) function LTR (easy, as the hard work has already been done for D functions) and change array ops to work with LTR extern(C) functions (needs quite some changes in the frontend and druntime, but it's not hard to implement). However, as soon as we change array ops in the frontend we break RTL backends(dmd, probably ldc). And fixing these backends as well is probably out of scope. We're probably not familiar with these and it might be a bad idea from a legal perspective as well? However, I think we could do this: * Make extern(C) functions LTR in GDC * Make array ops expect LTR C functions in the frontend and druntime * Introduce a Target::isExternCLTR flag * Add ~10 lines of special code for backends which use RTL: Just evaluate the parameters to VarDecls explicitly before passing them to the C function for array ops This way everything works for all compilers and as soon as all compilers have LTR evaluation we could remove Target::isExternCLTR and the extra code. -- Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.