From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7324 invoked by alias); 15 Jul 2004 22:35:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7314 invoked from network); 15 Jul 2004 22:35:49 -0000 Received: from unknown (HELO smtp2.clear.net.nz) (203.97.37.27) by sourceware.org with SMTP; 15 Jul 2004 22:35:49 -0000 Received: from DANNY (t001-m001-u97.acld.clear.net.nz [203.97.72.97]) by smtp2.clear.net.nz (CLEAR Net Mail) with SMTP id <0I0X00M6C03NH2@smtp2.clear.net.nz> for gcc-patches@gcc.gnu.org; Fri, 16 Jul 2004 10:35:48 +1200 (NZST) Date: Fri, 16 Jul 2004 08:14:00 -0000 From: Danny Smith Subject: Re: PATCH [cygwin/mingw ]: Don't add stdcall suffix to variadic functions To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, me@cgf.cx Reply-to: Danny Smith Message-id: <001e01c46abb$7ed54070$614861cb@DANNY> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit References: <20040715065333.32643.qmail@web50907.mail.yahoo.com> X-SW-Source: 2004-07/txt/msg01595.txt.bz2 ----- Original Message ----- From: "Jason Merrill" Subject: Re: PATCH [cygwin/mingw ]: Don't add stdcall suffix to variadic functions | On Thu, 15 Jul 2004 18:53:33 +1200 (NZST), Danny Smith wrote: | | > 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 | | Would it make more sense just to ignore the __stdcall for variadic | functions, since it doesn't work anyway? I tried that, by adding a check for TREE_VALUE (tree_last( TYPE_ARG_TYPES (TREE_TYPE (decl))) to the attribute handler in i386.c , but it didn't work, because at that point TARG_ARG_TYPES is still null. The __stdcall attribute is ignored for variadic functions in ix86_return_pops_args, where a similar check is made. Danny Danny | | Jason