[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Ellipsis patch
From: |
Jerry James |
Subject: |
[Gcl-devel] Ellipsis patch |
Date: |
Tue, 13 Oct 2009 10:36:13 -0600 |
I can't remember if I sent this one before or not. GCC complains
about undefined behavior when a varargs function's last non-varargs
parameter is declared to have storage class register. Since varargs
works by taking the address of that parameter, and register is a
promise to never take the address of a variable, the two conflict.
This patch fixes the issue.
diff -dur gcl-2.6.8.ORIG/o/bind.c gcl-2.6.8/o/bind.c
--- gcl-2.6.8.ORIG/o/bind.c 2006-06-21 14:03:05.000000000 -0600
+++ gcl-2.6.8/o/bind.c 2009-08-11 14:11:56.982474159 -0600
@@ -708,7 +708,7 @@
#define NOT_KEYWORD 1
void
-parse_key(object *base, bool rest, bool allow_other_keys, register int n, ...)
+parse_key(object *base, bool rest, bool allow_other_keys, int n, ...)
{
object temporary;
va_list ap;
diff -dur gcl-2.6.8.ORIG/o/external_funs.h gcl-2.6.8/o/external_funs.h
--- gcl-2.6.8.ORIG/o/external_funs.h 2003-08-29 14:41:59.000000000 -0600
+++ gcl-2.6.8/o/external_funs.h 2009-08-11 14:17:35.000473249 -0600
@@ -167,8 +167,8 @@
extern object find_special GPR((object body, struct bind_temp *start,
struct bind_temp *end));;
extern object let_bind GPR((object body, struct bind_temp *start,
struct bind_temp *end));;
extern object letA_bind GPR((object body, struct bind_temp *start,
struct bind_temp *end));;
-extern int parse_key GPR((object *base, bool rest, bool
allow_other_keys, register int n, int __builtin_va_alist));;
-extern int check_other_key GPR((object l, int n, int __builtin_va_alist));;
+extern int parse_key GPR((object *base, bool rest, bool
allow_other_keys, int n, ...));;
+extern int check_other_key GPR((object l, int n, ...));;
extern int parse_key_new GPR((int n, object *base, struct key *keys, ...));;
extern int parse_key_rest GPR((object rest, int n, object *base,
struct key *keys, ...));;
extern int set_key_struct GPR((struct key *ks, object data));;
@@ -380,7 +380,6 @@
extern int not_a_variable GPR((int obj));;
extern int illegal_index GPR((object x, object i));;
extern int Lerror GPR((void));;
-extern object LVerror GPR((int __builtin_va_alist));;
extern int Lcerror GPR((void));;
extern int vfun_wrong_number_of_args GPR((object x));;
extern int init_error GPR((void));;
@@ -415,9 +414,6 @@
extern object ifuncall2 GPR((object fun, object arg1, object arg2));;
extern object ifuncall3 GPR((object fun, object arg1, object arg2,
object arg3));;
extern int funcall_with_catcher GPR((object fname, object fun));;
-extern object fcalln_cclosure GPR((...));;
-extern object fcalln_general GPR((...));;
-extern object fcalln_vfun GPR((va_list vl));;
-extern object fcalln GPR((int __builtin_va_alist));;
-extern object funcall_cfun GPR((funcvoid fn, int n, int
__builtin_va_alist));;
+extern object fcalln GPR((object first, ...));;
+extern object funcall_cfun GPR((funcvoid fn, int n, ...));;
extern int init_eval GPR((void));;
--
Jerry James
http://www.jamezone.org/
- [Gcl-devel] Ellipsis patch,
Jerry James <=