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: stdcall function suffix and -mrtd on Win32


On Mon, Apr 25, 2005 at 05:11:17PM +0200, Filip Navara wrote:
>2005-04-25  Filip Navara  <navaraf@reactos.com>
>
>	* config/i386/winnt.c (i386_pe_encode_section_info):
>	Add stdcall suffix to functions that are implicitly declared
>	as stdcall when -mrtd option is used.
>
>--- config/i386/winnt.c	Thu Dec 30 22:38:22 2004
>+++ config/i386/winnt.c	Mon Apr 25 16:19:36 2005
>@@ -393,7 +393,9 @@ i386_pe_encode_section_info (tree decl, 
>       tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
>       tree newid = NULL_TREE;
> 
>-      if (lookup_attribute ("stdcall", type_attributes))
>+      if (!lookup_attribute ("cdecl", type_attributes) && TARGET_RTD)
>+	newid = gen_stdcall_or_fastcall_suffix (decl, false);
>+      else if (lookup_attribute ("stdcall", type_attributes))
> 	newid = gen_stdcall_or_fastcall_suffix (decl, false);
>       else if (lookup_attribute ("fastcall", type_attributes))
> 	newid = gen_stdcall_or_fastcall_suffix (decl, true);

Maybe it's just a personal preference (and a very minor point) but I
would prefer just having one if clause to catch the case of a stdcall,
i.e.,

  if (lookup_attribute ("stdcall", type_attributes)
      || (!lookup_attribute ("cdecl", type_attributes) && TARGET_RTD))
    newid = gen_stdcall_or_fastcall_suffix (decl, false);

You can check that into the trunk, if you want.

cgf


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