www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - __init_ vs _init_

reply "Ben Hinkle" <bhinkle mathworks.com> writes:
Does anyone know why D sometimes generates symbol names of the form
__init_10Typeinfo_i vs _init_10Typeinfo_i (note the number of leading
underscores). I'm trying to debug various Win32 linking error using MinTL
that seem to depend on its use of combinations of mixins and typeid and
vararg code. When I get a link error it is looking for the _init_ with one
underscore and everything works fine when it looks for __init_ with two
underscores. I've reverted to DMD-102 and the link errors go away but even
with 106 I still get them. Currently I've started commenting out MinTL code
to get something that works. On Linux everything seems ok.

-Ben
Nov 22 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Ben Hinkle" <bhinkle mathworks.com> wrote in message
news:cntgca$jq7$1 digitaldaemon.com...
 Does anyone know why D sometimes generates symbol names of the form
 __init_10Typeinfo_i vs _init_10Typeinfo_i (note the number of leading
 underscores). I'm trying to debug various Win32 linking error using MinTL
 that seem to depend on its use of combinations of mixins and typeid and
 vararg code. When I get a link error it is looking for the _init_ with one
 underscore and everything works fine when it looks for __init_ with two
 underscores. I've reverted to DMD-102 and the link errors go away but even
 with 106 I still get them. Currently I've started commenting out MinTL
code
 to get something that works. On Linux everything seems ok.
Are you trying to hook up to an import library written in D?
Nov 22 2004
parent "Ben Hinkle" <bhinkle mathworks.com> writes:
"Walter" <newshound digitalmars.com> wrote in message
news:cnthc7$lnt$1 digitaldaemon.com...
 "Ben Hinkle" <bhinkle mathworks.com> wrote in message
 news:cntgca$jq7$1 digitaldaemon.com...
 Does anyone know why D sometimes generates symbol names of the form
 __init_10Typeinfo_i vs _init_10Typeinfo_i (note the number of leading
 underscores). I'm trying to debug various Win32 linking error using
MinTL
 that seem to depend on its use of combinations of mixins and typeid and
 vararg code. When I get a link error it is looking for the _init_ with
one
 underscore and everything works fine when it looks for __init_ with two
 underscores. I've reverted to DMD-102 and the link errors go away but
even
 with 106 I still get them. Currently I've started commenting out MinTL
code
 to get something that works. On Linux everything seems ok.
Are you trying to hook up to an import library written in D?
It doesn't seem to matter if I use a library or list the relevant files explicitly: The symbol is defined in phobos with two underscores. By some combinations my object file sometimes ends up needing _init and sometimes ends up with __init. I've been trying to get simple reproduction steps but it seems pretty complicated. In MinTL it could involve three modules with a couple mixins and possible vararg functions (comparing against _arguments so it could be that _arguments is the first time the symbol is hit). Scatter throughout are typeid(T) where T is "int" (not that "int" is important - any type will do).
Nov 22 2004