This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: PATCH [cygwin/mingw ]: Don't add stdcall suffix to variadic functions


On Thu, Jul 15, 2004 at 06:53:33PM +1200, Danny Smith wrote:
>Hello,
>
>On i386-pe targets, stdcall functions are suffixed with @nn, when nn
>is the number of bytes in the parameter list.
>
>The native MS Windoes compiler decorates functions with
>empty parameter list, eg
>
>void __stdcall bar ();
>
>as _bar@0
>
>
>However, for variadic functions, which cannot be handled
>as __stdcall because the parameter list is indefinite, it
>leaves off the suffix
>eg.
>void __stdcall foo (int a, ...) 
>
>foo stays as _foo
>
>Currently gcc adds @0 suffix to both types of function
>
>The following patch makes gcc consistent with native compiler.  It also
>rationalizes the two functions gen_fastcall_sufffix  and gen_stdcall_suffix
>(which are identical except for two statements) into a single function
>
>bootstrapped/regtested i686-pc-mingw32
>
>Changelog
>
>2004-07-15  Danny Smith  <dannysmith@users.sourceforge.net>
>
>	* config/i386/winnt.c (gen_fastcall_or_stdcall_suffix):
>	New function combining ...
>	(gen_fastcall_suffix): Remove.
>	(gen_stdcall_suffix): Remove.
>	(i386_pe_encode_section_info): Update calls.
>
>	* config/i386/winnt.c (gen_fastcall_or_stdcall_suffix): Do not
>	add suffix or prefix if variadic function decl.
>
>testsuite/ChangeLog
>
>	gcc.dg/attr-stdcall-va.c: New file.

Ok to checkin.

Thanks,

cgf


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