This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
RE: symbol names are not created with stdcall syntax: MINGW, (GCC) 4.3.0 20061021
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: 'François-Xavier Coudert' <fxcoudert at gmail dot com>, 'Tobias Burnus' <burnus at net-b dot de>, 'GCC Development' <gcc at gcc dot gnu dot org>, dannysmith at users dot sourceforge dot net
- Cc: 'Steve Kargl' <sgk at troutmask dot apl dot washington dot edu>, fortran at gcc dot gnu dot org
- Date: Sat, 10 Mar 2007 14:58:26 +1300
- Subject: RE: symbol names are not created with stdcall syntax: MINGW, (GCC) 4.3.0 20061021
>
> On mingw, I get the following:
>
> $ cat a.c
> int foo(int x) { return x+1; }
> $ gcc.exe -mrtd a.c -shared -o a.dll
> $ nm a.dll | grep foo
> 100011c0 T _foo
>
> $ cat b.c
> int __stdcall foo(int x) { return x+1; }
> $ gcc.exe b.c -shared -o b.dll
> $ nm b.dll | grep foo
> 100011c0 T _foo@4
> $ gcc.exe b.c -shared -o b.dll -mrtd
> $ nm b.dll | grep foo
> 100011c0 T _foo@4
>
> I think -mrtd doesn't change the name.
Correct.
Maybe GCC needs another option
> to add the name decoration automatically? CCing the GCC list and Danny
> S. for this question.
>
IMO, anybody who uses -mrtd (with or without decorations) is asking for
trouble.
Unless you are planning to use a gfortran dll in a VisualBasic app, I
can see little reason to change from the default "C" calling convention.
Danny
> FX
>