[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 05:36:01 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=9655
--- Comment #10 from yebblies <yebblies at gmail.com> ---
(In reply to bearophile_hugs from comment #9)
> (In reply to yebblies from comment #7)
>
> > No, you shouldn't rely on this ever.
>
> Why?
Because in D it's specified that the functions may not have distinct addresses.
> I think the C standard requires those functions to have different
> addresses. So I think that C code is correct. (And indeed as far as I know
> GCC replaces equal function implementations with a jump, to keep addressed
> distinct).
In a language without templates, code folding is much less useful.
--
More information about the Digitalmars-d-bugs
mailing list