www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [Request for ABI Breakage]: Ambiguity between extern(Pascal) vs.

reply "Iain Buclaw" <ibuclaw gdcproject.org> writes:
In this small snippet:

   TS4html3dom4NodeVnnZ

How am I supposed to know the difference between an 
extern(Pascal) function:

   html.dom.Node(none, none)

And a template parameter list:

   html.dom.Node, null


Since use of extern(Pascal) should be exceedingly rare (I don't 
think I ever followed ABI convention in GDC) I'd either request 
that extern(Pascal) be removed completely, or have it's mangled 
symbol be renamed to something other than a 'V' that does not 
clash with other types/identifiers.

Regards
Iain
May 16 2015
next sibling parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Iain Buclaw"  wrote in message news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I don't think I 
 ever followed ABI convention in GDC) I'd either request that 
 extern(Pascal) be removed completely, or have it's mangled symbol be 
 renamed to something other than a 'V' that does not clash with other 
 types/identifiers.
Why do we even have extern(Pascal) ?
May 16 2015
parent reply Iain Buclaw via Digitalmars-d <digitalmars-d puremagic.com> writes:
On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I don't think I
 ever followed ABI convention in GDC) I'd either request that extern(Pascal)
 be removed completely, or have it's mangled symbol be renamed to something
 other than a 'V' that does not clash with other types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
May 16 2015
next sibling parent "Kagamin" <spam here.lot> writes:
AFAIK, pascal calling convention exists for 32-bit systems too: 
http://www.freepascal.org/docs-html/prog/progse22.html
May 16 2015
prev sibling next sibling parent reply "Iain Buclaw" <ibuclaw gdcproject.org> writes:
On Saturday, 16 May 2015 at 15:46:20 UTC, Iain Buclaw wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message 
 news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I 
 don't think I
 ever followed ABI convention in GDC) I'd either request that 
 extern(Pascal)
 be removed completely, or have it's mangled symbol be renamed 
 to something
 other than a 'V' that does not clash with other 
 types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
This is blocking me with improving demangling support in gdb/binutils. https://issues.dlang.org/show_bug.cgi?id=14591 https://github.com/D-Programming-Language/dmd/pull/4658 I may just drop support for recognising extern(Pascal) functions completely on my side.
May 16 2015
parent reply "weaselcat" <weaselcat gmail.com> writes:
On Saturday, 16 May 2015 at 19:11:26 UTC, Iain Buclaw wrote:
 On Saturday, 16 May 2015 at 15:46:20 UTC, Iain Buclaw wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message 
 news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I 
 don't think I
 ever followed ABI convention in GDC) I'd either request that 
 extern(Pascal)
 be removed completely, or have it's mangled symbol be 
 renamed to something
 other than a 'V' that does not clash with other 
 types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
This is blocking me with improving demangling support in gdb/binutils. https://issues.dlang.org/show_bug.cgi?id=14591 https://github.com/D-Programming-Language/dmd/pull/4658 I may just drop support for recognising extern(Pascal) functions completely on my side.
Sorry for the noise, but since you're here C++filt in binutils lists dlang support in the help but it doesn't actually work. Do I report this on binutils issue tracker, or gdc's?
May 16 2015
parent reply "Iain Buclaw" <ibuclaw gdcproject.org> writes:
On Saturday, 16 May 2015 at 19:16:04 UTC, weaselcat wrote:
 On Saturday, 16 May 2015 at 19:11:26 UTC, Iain Buclaw wrote:
 On Saturday, 16 May 2015 at 15:46:20 UTC, Iain Buclaw wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message 
 news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I 
 don't think I
 ever followed ABI convention in GDC) I'd either request 
 that extern(Pascal)
 be removed completely, or have it's mangled symbol be 
 renamed to something
 other than a 'V' that does not clash with other 
 types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
This is blocking me with improving demangling support in gdb/binutils. https://issues.dlang.org/show_bug.cgi?id=14591 https://github.com/D-Programming-Language/dmd/pull/4658 I may just drop support for recognising extern(Pascal) functions completely on my side.
Sorry for the noise, but since you're here C++filt in binutils lists dlang support in the help but it doesn't actually work. Do I report this on binutils issue tracker, or gdc's?
Binutils. Other tools may need similarly to be updated.
May 16 2015
parent "Iain Buclaw" <ibuclaw gdcproject.org> writes:
On Saturday, 16 May 2015 at 19:21:31 UTC, Iain Buclaw wrote:
 On Saturday, 16 May 2015 at 19:16:04 UTC, weaselcat wrote:
 On Saturday, 16 May 2015 at 19:11:26 UTC, Iain Buclaw wrote:
 On Saturday, 16 May 2015 at 15:46:20 UTC, Iain Buclaw wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message 
 news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I 
 don't think I
 ever followed ABI convention in GDC) I'd either request 
 that extern(Pascal)
 be removed completely, or have it's mangled symbol be 
 renamed to something
 other than a 'V' that does not clash with other 
 types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
This is blocking me with improving demangling support in gdb/binutils. https://issues.dlang.org/show_bug.cgi?id=14591 https://github.com/D-Programming-Language/dmd/pull/4658 I may just drop support for recognising extern(Pascal) functions completely on my side.
Sorry for the noise, but since you're here C++filt in binutils lists dlang support in the help but it doesn't actually work. Do I report this on binutils issue tracker, or gdc's?
Binutils. Other tools may need similarly to be updated.
By the way, "doesn't actually work" may need some explaining. (It works for me, for instance).
May 16 2015
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 5/16/2015 8:46 AM, Iain Buclaw via Digitalmars-d wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I don't think I
 ever followed ABI convention in GDC) I'd either request that extern(Pascal)
 be removed completely, or have it's mangled symbol be renamed to something
 other than a 'V' that does not clash with other types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
Windows API calls used it.
May 16 2015
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 5/16/15 10:36 PM, Walter Bright wrote:
 On 5/16/2015 8:46 AM, Iain Buclaw via Digitalmars-d wrote:
 On 16 May 2015 at 16:34, Daniel Murphy via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 "Iain Buclaw"  wrote in message
 news:uzmzjndohsiaewkjmchu forum.dlang.org...

 Once use of extern(Pascal) should be exceedingly rare (I don't think I
 ever followed ABI convention in GDC) I'd either request that
 extern(Pascal)
 be removed completely, or have it's mangled symbol be renamed to
 something
 other than a 'V' that does not clash with other types/identifiers.
Why do we even have extern(Pascal) ?
No idea. D has never supported 16-bit systems. Walter?
Windows API calls used it.
So would it make sense to use extern(Pascal) to only deal with Windows API calls? I can't see the OP's case html.dom.Node(none, none) being a Windows call. I'd also call it something else besides extern(Pascal) to avoid confusion. -Steve
May 18 2015
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 5/18/2015 6:51 AM, Steven Schveighoffer wrote:
 I'd also call it something else besides extern(Pascal) to avoid confusion.
It's called "pascal" on the extensions to the C/C++ compilers.
May 18 2015
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 5/18/15 3:48 PM, Walter Bright wrote:
 On 5/18/2015 6:51 AM, Steven Schveighoffer wrote:
 I'd also call it something else besides extern(Pascal) to avoid
 confusion.
It's called "pascal" on the extensions to the C/C++ compilers.
I meant call it something else, so it's not confused with the original meaning of extern(Pascal). If you decided to limit it to only Windows API or similar functions. -Steve
May 18 2015
parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Steven Schveighoffer"  wrote in message 
news:mjdgdk$15c4$1 digitalmars.com...

 I meant call it something else, so it's not confused with the original 
 meaning of extern(Pascal). If you decided to limit it to only Windows API 
 or similar functions.
It's not used for the Windows API, it _was_ used for the Windows API. The current calling convention is extern(Windows) which is IIRC the same thing with the argument push order reversed. It might still survive in a few dark corners, not sure.
May 19 2015
prev sibling parent "Martin Nowak" <code dawg.eu> writes:
On Saturday, 16 May 2015 at 09:07:57 UTC, Iain Buclaw wrote:
 or have it's mangled symbol be renamed to something other than 
 a 'V' that does not clash with other types/identifiers.
Well, change it to whatever letter works, if that resolves mangling ambiguities.
May 18 2015