The "register" keyword is a promise to never take the address of a variable. When using an ellipsis to create a variable argument function, the last parameter before the ellipsis is passed to va_start(), which uses the address of that parameter to find the unnamed parameters.
We have a case where the last parameter before an ellipsis is declared "register", which means that we are breaking our promise to the compiler to never take the address of that parameter. GCC 4.4.0 issues a warning about undefined behavior. The fix is to remove the "register" declaration. The attached patch does so. Regards, -- Jerry James http://www.jamezone.org/
diff -dur gcl-2.7.0.ORIG/h/protoize.h gcl-2.7.0/h/protoize.h --- gcl-2.7.0.ORIG/h/protoize.h 2009-02-26 19:24:45.000000000 -0700 +++ gcl-2.7.0/h/protoize.h 2009-05-20 15:38:41.357515471 -0600 @@ -93,7 +93,7 @@ /* bind.c:610:OF */ extern object find_special (object body, struct bind_temp *start, struct bind_temp *end,object *); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ /* bind.c:670:OF */ extern object let_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ /* bind.c:688:OF */ extern object letA_bind (object body, struct bind_temp *start, struct bind_temp *end); /* (body, start, end) object body; struct bind_temp *start; struct bind_temp *end; */ -/* bind.c:712:OF */ extern void parse_key (object *base, bool rest, bool allow_other_keys, register int n, ... ); +/* bind.c:712:OF */ extern void parse_key (object *base, bool rest, bool allow_other_keys, int n, ... ); /* bind.c:820:OF */ extern void check_other_key (object l, int n, ...); struct key {short n,allow_other_keys; iobject *defaults; diff -dur gcl-2.7.0.ORIG/o/bind.c gcl-2.7.0/o/bind.c --- gcl-2.7.0.ORIG/o/bind.c 2009-03-05 13:34:58.000000000 -0700 +++ gcl-2.7.0/o/bind.c 2009-05-20 15:38:07.916384884 -0600 @@ -741,7 +741,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.7.0.ORIG/o/external_funs.h gcl-2.7.0/o/external_funs.h --- gcl-2.7.0.ORIG/o/external_funs.h 2007-12-16 01:56:43.000000000 -0700 +++ gcl-2.7.0/o/external_funs.h 2009-05-20 15:39:58.588418609 -0600 @@ -167,7 +167,7 @@ extern object find_special GPR((object body, struct bind_temp *start, struct bind_temp *end,object *));; 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 parse_key GPR((object *base, bool rest, bool allow_other_keys, int n, int __builtin_va_alist));; extern int check_other_key GPR((object l, int n, int __builtin_va_alist));; 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, ...));;
_______________________________________________ Gcl-devel mailing list Gcl-devel@gnu.org http://lists.gnu.org/mailman/listinfo/gcl-devel