[Issue 9655] Two functions with identical implementations are allowed to have the same address

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 31 03:29:46 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=9655

--- Comment #6 from bearophile_hugs at eml.cc ---
(In reply to github-bugzilla from comment #5)
> Commit pushed to master at
> https://github.com/D-Programming-Language/dlang.org
> 
> https://github.com/D-Programming-Language/dlang.org/commit/
> e5d39c811d080ad8aae8903e96711f7f7715ca99
> Merge pull request #684 from quickfur/issue9655
> 
> Issue 9655: Functions with identical bodies are allowed to be merged by
> compiler.

This is not enough. What do you have to do if you want to be certain to have
distinct D functions pointers even if the function body may or may not be the
same? (There is C code out there that relies on this guaranteed, like some
evolutionary algorithm that breeds functions). Are D functions tagged with
extern(C) exempt from this optimization?

--


More information about the Digitalmars-d-bugs mailing list