This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: STDCALL first patch


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]