A new debugger for Linux - would it work for D?
Don Clugston
dac at nospam.com.au
Thu Nov 23 03:17:01 PST 2006
Bruno Medeiros wrote:
> Don Clugston wrote:
>>
>> - Items that use D mangling but don't have D linkage. I suggest
>> changing those cases to use "0" then the linkage type ('W' for
>> Windows, 'U', for C, etc, same as for delegate/function pointers),
>> then the length.
>> So instead of
>> main3abci
>>
>> it would be
>> 0U4main3abci
>>
>> for
>>
>> void main()
>> {
>> int abc;
>> }
>>
>>
>> making it distinguishable from
>> extern(Windows)
>> {
>> int main3abci;
>> }
>>
>
> Can we define functions that do not have D linkage, but have D name
> mangling? If so, does that even make sense? It was my understanding that
> any function with linkage other than D is used for obj/lib/dll level
> compatibility with other programs written in other languages (i.e., ABI
> level compatibility). As such, these other languages don't understand D
> name mangling but only C name mangling, so what's a non-D-linkage with
> D-name-mangling for?
These symbols cannot be externally linked directly, but it can be
important for eg alias template parameters. (Everything needs to be
manglable, even it can't be linked directly).
extern(C) {
void func() {
// 'func' uses C name mangling
void inner() {
// 'inner' uses D name mangling.
// So 'func.inner' is a hybrid.
}
}
}
It's even possible to have extern(Windows) inner functions inside
extern(C) functions!
More information about the Digitalmars-d-announce
mailing list