From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10266 invoked by alias); 15 Nov 2007 18:23:08 -0000 Received: (qmail 10152 invoked by uid 48); 15 Nov 2007 18:22:57 -0000 Date: Thu, 15 Nov 2007 18:23:00 -0000 Subject: [Bug fortran/34112] New: Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg01425.txt.bz2 32bit Windows uses a different calling convention (called procedure pops the stack, not caller) with a symbol 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