This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: STDCALL first patch
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Danny Smith <dannysmith at clear dot net dot nz>, 'Fortran List' <fortran at gcc dot gnu dot org>
- Date: Tue, 4 Mar 2008 21:29:25 +0000
- Subject: Re: STDCALL first patch
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; bh=WW416Y2jJDV00yV59SfMrtIJTYPrSxSLcW0+mcJu52o=; b=cCLwGj6wT3Qb1N+Fsxtrll2A/w7GOVUFDXSNU2miGq+BzhHoHUHnBuAWKXTbHM5M1ylrUo0Mem2rHYi5/L57kviBTkSy1+72OyupBcMFQDOj01HQHZmFgVYtyObio6RuHx9UhVh92Rb4t8YZ9XpvxFxSw5uvYUzxROzgfAsraSo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=fzL07kxKaRDpImCgypyQaN9KT3f2HvTs3f6JtniJR2qSj2f62PUxrFp9AbLBcV3CK3I7zbAMFrsubsNgeHzTskn9BylEjx2qqjNi9RMdZV6npQ93+bi8QccAbkkVE5e2ioZe3L2S4Vcp+9kSrvd91dSOE3zwOOHOPmeuVl0Dv2Q=
- References: <000001c87d76$685d5860$8f6d65da@THOMAS> <06F86400-275A-46A4-A968-150303495357@gmail.com> <47CDAEE7.2020909@net-b.de>
Hi,
In general it would be good to support !DEC$ as it is a de-facto
standard for Windows. On the other hand I agree that with !GNU$ one
would be more flexible / simpler for us.
My problem with ATTRIBUTES other than DECORATE and STDCALL is the
following: How does it interact with with BIND(C)? It was invented
before BIND(C) was available. Using !DEC$ or !GNU$ with BIND(C),
however, makes live much simpler: Then one does not need ALIAS but
uses simply the BIND(C, name="...") which would be automatically
"@nn"-decorated with DECORATE and otherwise not.
Intel write (see c.l.f link in PR, message 26): "You don't mix
ALIAS with BIND(C,name=). One or the other. I'm not sure if the
current compiler will diagnose this, but a future one will.
STDCALL does not imply BIND(C)."
I think this sums things up quite nicely, and that's my argument for
not supporting !DEC$ but providing our own !GNU$ attributes instead:
if we support !DEC$, we'll probably have to support a wide range of
them, including ALIAS, C, DECORATE and many more. If we go for !GNU$,
we provide the functionality in a way that's easiest to maintain and
more compatible with the rest of GCC. So, all in all, I'm for
advising people to use BIND(C) along with !GNU$ ATTRIBUTES STDCALL /
DECORATE / DLLIMPORT / DLLEXPORT...
Just think that, in the end, Win64 will come and STDCALL will go :)
By adding !GNU$ support, we provide generic attributes functionality,
that can also be useful on other targets (think user-specified
alignment, for example).
Danny, regarding the documentation, I think the documentation
linked in the bug report is the official one:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112
I'm temporarily hosting a copy of the Intel manual here: http://
www.coudert.name/tmp/IntelManual.pdf (the ATTRIBUTES doc starts at
page 485).
FX
--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/