This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libobjc] fix to nil_method
- From: Andreas Jaeger <aj at suse dot de>
- To: Stan Shebs <shebs at apple dot com>
- Cc: Nicola Pero <nicola at brainstorm dot co dot uk>, Jan Hubicka <jh at suse dot cz>,gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Sep 2002 14:14:39 +0200
- Subject: Re: [libobjc] fix to nil_method
- References: <Pine.LNX.4.21.0208301304150.3814-100000@nicola.brainstorm.co.uk><3D73C89F.9000902@apple.com>
Stan Shebs <shebs@apple.com> writes:
> The patch basically makes nil_method look non-variadic to the runtime,
> and seems adequate as a workaround, since it would be pretty hard to
> rewrite the codegen/runtime machinery to not fake up function
> signatures. So let's go with the patch, adding an explanatory
> comment so that some energetic person doesn't come along and add
> the signature back later. :-)
Ok, here's what I've just commit on behalf of Jan - after testing on
both i686-linux and x86_64-linux,
Andreas
2002-09-10 Jan Hubicka <jh@suse.cz>
* nil_method.c (nil_method): No longer varardic.
Index: libobjc/nil_method.c
===================================================================
RCS file: /cvs/gcc/egcs/libobjc/nil_method.c,v
retrieving revision 1.4
diff -u -p -r1.4 nil_method.c
--- libobjc/nil_method.c 2 Jul 2002 19:42:38 -0000 1.4
+++ libobjc/nil_method.c 10 Sep 2002 07:56:57 -0000
@@ -29,8 +29,12 @@ Boston, MA 02111-1307, USA. */
#include "runtime.h"
+/* nil_method is declared with variable arguments but the runtime calls it
+ in a way that does not setup the variable arguments correctly. Some Architectures
+ that have special arg calling conventions like x86-64 do need every function with
+ variable arguments called the correct way. */
id
-nil_method (id receiver, SEL op __attribute__ ((__unused__)), ...)
+nil_method (id receiver, SEL op __attribute__ ((__unused__)))
{
return receiver;
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj