[Bug fortran/34112] New: Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Nov 15 18:23:00 GMT 2007
32bit Windows uses a different calling convention (called procedure pops the
stack, not caller) with a symbol name _<name>@n, where n is the number of bytes
to pop off.
See also:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/19d77dfc75f8be58
http://gcc.gnu.org/ml/fortran/2007-11/msg00074.html
As the standard makes not provisions and !DEC$ (*DEC$, cDEC$) is widely used,
gfortran should accept the following:
function CallWndRetProc(nCode, wParam, lParam)
!DEC$ ATTRIBUTES STDCALL,DECORATE, ALIAS: 'CallWndRetProc' :: CallWndRetProc
end function
Documentation:
http://www.intel.com/software/products/compilers/docs/fmac/doc_files/source/extfile/lref_for/source_files/rfattcst.htm
http://www.intel.com/software/products/compilers/docs/fmac/doc_files/source/extfile/lref_for/source_files/rfattrib.htm
They seem to map to
(http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html):
STDCALL -> __attribute__(stdcall)
ALIAS -> __attribute__(alias("name"))
DECORATE -> ?
The problem with decorate is that its meaning depends on the platform. It may
decorate the "name" of alias with a "_" prefix and "@n" postfix or only with a
"_" prefix. Maybe one should start with STDCALL and ALIAS.
For alias one should do something as in c-pragma.c's apply_pragma_weak:
decl_attributes (&decl, build_tree_list (get_identifier ("alias"),
build_tree_list (NULL, value)),
0);
--
Summary: Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112
More information about the Gcc-bugs
mailing list