This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH [cygwin/mingw ]: Don't add stdcall suffix to variadic functions
- From: Christopher Faylor <me at cgf dot cx>
- To: Danny Smith <danny_smith_0000 at yahoo dot co dot nz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jul 2004 08:07:23 -0400
- Subject: Re: PATCH [cygwin/mingw ]: Don't add stdcall suffix to variadic functions
- References: <20040715065333.32643.qmail@web50907.mail.yahoo.com>
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