March 24, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Minkov | Yes Ilya, but the case in question *has* an extern (C) attribute ... to wit: extern (C) int memcmp (void *, void *, uint); - Kris "Ilya Minkov" <minkov@cs.tum.edu> wrote in message news:c3q886$2gk2$1@digitaldaemon.com... > Kris schrieb: > > > As Carlos says: even if it's static within the class it will still be name-mangled. The only solution is apparently to move such declarations up > > to module-scope. > > > > - Kris > > All declarations are name mangled in D, because they are mangled with module name and arguments. Exceptions are all declarations with extern(C/Pascal/Windows/...) sorts where name mangling is to be turned off. Always, not depending on whether it's a static member or module scope level. Obviously, making non-static members or inner functions extern is unfeasible. > > -eye |
March 24, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | On Tue, 23 Mar 2004 16:34:51 -0800 (24/Mar/04 11:34:51 AM) , Kris <someidiot@earthlink.net> wrote: > Yes Ilya, but the case in question *has* an extern (C) attribute ... to wit: > > extern (C) int memcmp (void *, void *, uint); > > - Kris > > "Ilya Minkov" <minkov@cs.tum.edu> wrote in message > news:c3q886$2gk2$1@digitaldaemon.com... >> Kris schrieb: >> >> > As Carlos says: even if it's static within the class it will still be >> > name-mangled. The only solution is apparently to move such >> declarations > up >> > to module-scope. >> > >> > - Kris >> >> All declarations are name mangled in D, because they are mangled with >> module name and arguments. Exceptions are all declarations with >> extern(C/Pascal/Windows/...) sorts where name mangling is to be turned >> off. Always, not depending on whether it's a static member or module >> scope level. Obviously, making non-static members or inner functions >> extern is unfeasible. >> Doesn't the 'extern (C)' qualification just tell DMD to avoid name-mangling for this function identifer? I can't see what you are trying to achieve by placing the memcmp reference inside a class definition. To me, it seems natural to place such 'extern (C)' references outside all any class. -- Derek |
March 24, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | Derek: It was just a small convenience to place the declaration along with the version() stuff (windows vs linux) within a class along with version specific import's and so on. I usually like to keep related things together. But the issue is really one of clarity: it's pretty clear that the extern() mangling behavior was somewhat misunderstood, and not documented anywhere. - Kris "Derek Parnell" <Derek.Parnell@psyc.ward> wrote in message news:opr5cb75e3u2m3b2@news.digitalmars.com... > On Tue, 23 Mar 2004 16:34:51 -0800 (24/Mar/04 11:34:51 AM) > , Kris <someidiot@earthlink.net> wrote: > > > Yes Ilya, but the case in question *has* an extern (C) attribute ... to > > wit: > > > > extern (C) int memcmp (void *, void *, uint); > > > > - Kris > > > > "Ilya Minkov" <minkov@cs.tum.edu> wrote in message news:c3q886$2gk2$1@digitaldaemon.com... > >> Kris schrieb: > >> > >> > As Carlos says: even if it's static within the class it will still be name-mangled. The only solution is apparently to move such > >> declarations > > up > >> > to module-scope. > >> > > >> > - Kris > >> > >> All declarations are name mangled in D, because they are mangled with module name and arguments. Exceptions are all declarations with extern(C/Pascal/Windows/...) sorts where name mangling is to be turned off. Always, not depending on whether it's a static member or module scope level. Obviously, making non-static members or inner functions extern is unfeasible. > >> > > Doesn't the 'extern (C)' qualification just tell DMD to avoid name-mangling for this function identifer? > > I can't see what you are trying to achieve by placing the memcmp reference inside a class definition. To me, it seems natural to place such 'extern (C)' references outside all any class. > > -- > Derek |
March 26, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | Off Topic - I can't seem to have Thunderbird mark this thread as "read" - anyone else having the same issue or am I losing my marbles?
Kris wrote:
> Pre v0.81 this would link correctly:
>
> class Token
> {
> extern (C) int memcmp (void *, void *, uint);
>
> void test()
> {
> memcmp (..., ..., ...);
> }
> }
>
> with v0.81, the linker fails with:
>
> Error 42: Symbol Undefined __D5hello5Token6memcmpUPvPvkZi
>
> If I move the extern (C) declaration outside of the class definition (up to
> the global scope) it links correctly:
>
> extern (C) int memcmp (void *, void *, uint);
>
> class Token
> {
> void test()
> {
> memcmp (..., ..., ...);
> }
> }
>
> Was this an intended change of symbol naming?
>
>
|
March 26, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | I would think that this takes time in a newsgroup like this, and you may want to leave it alone for 20 seconds or so while it is showing you a sandclock.
Or what do you mean?
-eye
Brad Anderson schrieb:
> Off Topic - I can't seem to have Thunderbird mark this thread as "read" - anyone else having the same issue or am I losing my marbles?
|
March 27, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Minkov | This issue is since yesterday. When I collapse the thread, it still has an underline, meaning there's at least one unread message in the thread. When I expand it, all are read. It's almost like someone posted a message and cancelled it before I read it. Who knows. It's not that big of a deal.
BA
Ilya Minkov wrote:
> I would think that this takes time in a newsgroup like this, and you may want to leave it alone for 20 seconds or so while it is showing you a sandclock.
>
> Or what do you mean?
>
> -eye
>
> Brad Anderson schrieb:
>
>> Off Topic - I can't seem to have Thunderbird mark this thread as "read" - anyone else having the same issue or am I losing my marbles?
|
March 27, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | Brad Anderson wrote: > This issue is since yesterday. When I collapse the thread, it still has an underline, meaning there's at least one unread message in the thread. When I expand it, all are read. It's almost like someone posted a message and cancelled it before I read it. Who knows. It's not that big of a deal. > > BA I get this problem as well. I just ignore it. Or you can read everything and then reset everything, and mark everything as read. But that still doesn't work sometimes. -- -Anderson: http://badmama.com.au/~anderson/ |
March 27, 2004 Re: [BUG] extern (C) behavior changed in v0.81 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | I think there was some sort of reordering yesterday or so, messages began disappearing one by one. Then i had clicked out of the newsgroup and back in and it restored all. I'm using the big Mozilla 1.6.
-eye
Brad Anderson schrieb:
> This issue is since yesterday. When I collapse the thread, it still has an underline, meaning there's at least one unread message in the thread. When I expand it, all are read. It's almost like someone posted a message and cancelled it before I read it. Who knows. It's not that big of a deal.
>
> BA
|
Copyright © 1999-2021 by the D Language Foundation