diff -ur ruby-1.0-971204/array.c ruby-1.0-971204-fix/array.c
--- ruby-1.0-971204/array.c	1997-10-22 12:52:12.000000000 +0900
+++ ruby-1.0-971204-fix/array.c	2025-12-02 11:23:29.880513794 +0900
@@ -15,6 +15,7 @@
 VALUE cArray;
 
 VALUE rb_to_a();
+extern void TypeError(char *, ...);
 
 #define ARY_DEFAULT_SIZE 16
 
@@ -82,12 +83,10 @@
     return ary_new2(ARY_DEFAULT_SIZE);
 }
 
-#include <varargs.h>
+#include <stdarg.h>
 
 VALUE
-ary_new3(n, va_alist)
-    int n;
-    va_dcl
+ary_new3(int n, ...)
 {
     va_list ar;
     struct RArray* ary;
@@ -98,7 +97,7 @@
     }
     ary = (struct RArray*)ary_new2(n<ARY_DEFAULT_SIZE?ARY_DEFAULT_SIZE:n);
 
-    va_start(ar);
+    va_start(ar, n);
     for (i=0; i<n; i++) {
 	ary->ptr[i] = va_arg(ar, VALUE);
     }
diff -ur ruby-1.0-971204/class.c ruby-1.0-971204-fix/class.c
--- ruby-1.0-971204/class.c	1997-09-03 17:32:12.000000000 +0900
+++ ruby-1.0-971204-fix/class.c	2025-12-02 11:29:02.094934750 +0900
@@ -305,7 +305,7 @@
     rb_define_singleton_method(module, name, func, argc);
 }
 
-VALUE mKernel;
+extern VALUE mKernel;
 
 void
 rb_define_global_function(name, func, argc)
@@ -349,22 +349,18 @@
     }
 }
 
-#include <varargs.h>
+#include <stdarg.h>
 #include <ctype.h>
 
 int
-rb_scan_args(argc, argv, fmt, va_alist)
-    int argc;
-    VALUE *argv;
-    char *fmt;
-    va_dcl
+rb_scan_args(int argc, VALUE *argv, char *fmt, ...)
 {
     int n, i;
     char *p = fmt;
     VALUE *var;
     va_list vargs;
 
-    va_start(vargs);
+    va_start(vargs, fmt);
 
     if (*p == '*') {
 	var = va_arg(vargs, VALUE*);
diff -ur ruby-1.0-971204/error.c ruby-1.0-971204-fix/error.c
--- ruby-1.0-971204/error.c	1997-10-07 13:30:38.000000000 +0900
+++ ruby-1.0-971204-fix/error.c	2025-12-02 11:27:13.244194350 +0900
@@ -13,7 +13,7 @@
 #include "ruby.h"
 #include "env.h"
 #include <stdio.h>
-#include <varargs.h>
+#include <stdarg.h>
 
 extern char *sourcefile;
 extern int   sourceline;
@@ -68,36 +68,30 @@
 }
 
 void
-Error(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Error(char *fmt, ...)
 {
     va_list args;
 
-    va_start(args);
+    va_start(args, fmt);
     err_print(fmt, args);
     va_end(args);
     nerrs++;
 }
 
 void
-Error_Append(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Error_Append(char *fmt, ...)
 {
     va_list args;
     char buf[BUFSIZ];
 
-    va_start(args);
+    va_start(args, fmt);
     vsprintf(buf, fmt, args);
     va_end(args);
     err_append(buf);
 }
 
 void
-Warning(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Warning(char *fmt, ...)
 {
     char buf[BUFSIZ];
     va_list args;
@@ -106,15 +100,13 @@
 
     sprintf(buf, "warning: %s", fmt);
 
-    va_start(args);
+    va_start(args, fmt);
     err_print(buf, args);
     va_end(args);
 }
 
 void
-Bug(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Bug(char *fmt, ...)
 {
     char buf[BUFSIZ];
     va_list args;
@@ -122,7 +114,7 @@
     sprintf(buf, "[BUG] %s", fmt);
     rb_in_eval = 0;
 
-    va_start(args);
+    va_start(args, fmt);
     err_print(buf, args);
     va_end(args);
     abort();
@@ -156,7 +148,7 @@
     -1,		0,
 };
 
-extern void TypeError();
+extern void TypeError(char *, ...);
 
 void
 rb_check_type(x, t)
@@ -267,7 +259,6 @@
     int argc;
     VALUE *argv;
 {
-    void ArgError();
     VALUE v = Qnil;
     int i;
     ID id;
@@ -293,7 +284,11 @@
 static VALUE *syserr_list;
 
 #ifndef NT
+#  ifdef __GLIBC__
+#    define sys_nerr 256 /* Modern glibc doesn't export sys_nerr */
+#  else
 extern int sys_nerr;
+#  endif
 #endif
 
 static void
@@ -341,7 +336,7 @@
     va_list args;\
     char buf[BUFSIZ];\
 \
-    va_start(args);\
+    va_start(args, fmt);\
     vsprintf(buf, fmt, args);\
     va_end(args);\
 \
@@ -349,50 +344,37 @@
 }
 
 void
-Raise(exc, fmt, va_alist)
-    VALUE exc;
-    char *fmt;
-    va_dcl
+Raise(VALUE exc, char *fmt, ...)
 {
     RAISE_ERROR(exc);
 }
 
 void
-TypeError(fmt, va_alist)
-    char *fmt;
-    va_dcl
+TypeError(char *fmt, ...)
 {
     RAISE_ERROR(eTypeError);
 }
 
 void
-ArgError(fmt, va_alist)
-    char *fmt;
-    va_dcl
+ArgError(char *fmt, ...)
 {
     RAISE_ERROR(eArgError);
 }
 
 void
-NameError(fmt, va_alist)
-    char *fmt;
-    va_dcl
+NameError(char *fmt, ...)
 {
     RAISE_ERROR(eNameError);
 }
 
 void
-IndexError(fmt, va_alist)
-    char *fmt;
-    va_dcl
+IndexError(char *fmt, ...)
 {
     RAISE_ERROR(eIndexError);
 }
 
 void
-Fail(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Fail(char *fmt, ...)
 {
     RAISE_ERROR(eRuntimeError);
 }
@@ -406,22 +388,18 @@
 }
 
 void
-LoadError(fmt, va_alist)
-    char *fmt;
-    va_dcl
+LoadError(char *fmt, ...)
 {
     RAISE_ERROR(eLoadError);
 }
 
 void
-Fatal(fmt, va_alist)
-    char *fmt;
-    va_dcl
+Fatal(char *fmt, ...)
 {
     va_list args;
     char buf[BUFSIZ];
 
-    va_start(args);
+    va_start(args, fmt);
     vsprintf(buf, fmt, args);
     va_end(args);
 
diff -ur ruby-1.0-971204/eval.c ruby-1.0-971204-fix/eval.c
--- ruby-1.0-971204/eval.c	1997-10-07 14:05:50.000000000 +0900
+++ ruby-1.0-971204-fix/eval.c	2025-12-02 16:00:33.854400720 +0900
@@ -37,6 +37,8 @@
 VALUE cProc;
 static VALUE proc_call();
 static VALUE f_binding();
+extern VALUE ary_entry();
+extern VALUE ary_unshift();
 
 #define CACHE_SIZE 0x200
 #define CACHE_MASK 0x1ff
@@ -397,7 +399,7 @@
 #define JUMP_TAG(st) {			\
     the_frame = prot_tag->frame;	\
     the_iter = prot_tag->iter;		\
-    longjmp(prot_tag->buf,(int)(st));	\
+    longjmp(prot_tag->buf,(uintptr_t)(st));	\
 }
 
 #define JUMP_TAG3(val,data1,data2) \
@@ -2254,10 +2256,6 @@
     JUMP_TAG2(TAG_RETRY, 0);
 }
 
-#ifdef __GNUC__
-static volatile voidfn rb_longjmp;
-#endif
-
 static VALUE make_backtrace();
 
 static void
@@ -3156,14 +3154,10 @@
     return vid;
 }
 
-#include <varargs.h>
+#include <stdarg.h>
 
 VALUE
-rb_funcall(recv, mid, n, va_alist)
-    VALUE recv;
-    ID mid;
-    int n;
-    va_dcl
+rb_funcall(VALUE recv, ID mid, int n, ...)
 {
     va_list ar;
     VALUE *argv;
@@ -3173,7 +3167,7 @@
 
 	argv = ALLOCA_N(VALUE, n);
 
-	va_start(ar);
+	va_start(ar, n);
 	for (i=0;i<n;i++) {
 	    argv[i] = va_arg(ar, VALUE);
 	}
diff -ur ruby-1.0-971204/glob.c ruby-1.0-971204-fix/glob.c
--- ruby-1.0-971204/glob.c	1997-09-03 17:32:13.000000000 +0900
+++ ruby-1.0-971204-fix/glob.c	2025-12-02 11:26:54.123877675 +0900
@@ -81,6 +81,8 @@
 #else
 #if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
 #include <alloca.h>
+#elif defined(__GNUC__)
+#define alloca __builtin_alloca
 #else
 char *alloca ();
 #endif
diff -ur ruby-1.0-971204/hash.c ruby-1.0-971204-fix/hash.c
--- ruby-1.0-971204/hash.c	1997-09-03 17:32:13.000000000 +0900
+++ ruby-1.0-971204-fix/hash.c	2025-12-02 14:07:58.161269798 +0900
@@ -375,7 +375,7 @@
     struct RHash *hash;
 {
     rb_secure(5);
-    st_foreach(hash->tbl, clear_i);
+    st_foreach(hash->tbl, clear_i, NULL);
 
     return (VALUE)hash;
 }
diff -ur ruby-1.0-971204/io.c ruby-1.0-971204-fix/io.c
--- ruby-1.0-971204/io.c	1997-12-01 12:43:57.000000000 +0900
+++ ruby-1.0-971204-fix/io.c	2025-12-02 11:25:48.765797271 +0900
@@ -73,19 +73,23 @@
 
 struct timeval time_timeval();
 
-#ifdef _STDIO_USES_IOSTREAM  /* GNU libc */
-#  ifdef _IO_fpos_t
-#    define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
-#  else
-#    define READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr)
-#  endif
+/* Modern glibc uses _IO_read_ptr */
+#ifdef __GLIBC__
+#  define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
 #else
-#  ifdef FILE_COUNT
-#    define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
+#  ifdef _STDIO_USES_IOSTREAM  /* GNU libc */
+#    ifdef _IO_fpos_t
+#      define READ_DATA_PENDING(fp) ((fp)->_IO_read_ptr != (fp)->_IO_read_end)
+#    else
+#      define READ_DATA_PENDING(fp) ((fp)->_gptr < (fp)->_egptr)
+#    endif
 #  else
-/* requires systems own version of the ReadDataPending() */
-extern int ReadDataPending();
-#    define READ_DATA_PENDING(fp) ReadDataPending(fp)
+#    ifdef FILE_COUNT
+#      define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
+#    else
+/* Fallback: assume no pending data */
+#      define READ_DATA_PENDING(fp) 0
+#    endif
 #  endif
 #endif
 
diff -ur ruby-1.0-971204/node.h ruby-1.0-971204-fix/node.h
--- ruby-1.0-971204/node.h	1997-08-19 16:23:58.000000000 +0900
+++ ruby-1.0-971204-fix/node.h	2025-12-02 16:39:56.763184753 +0900
@@ -109,7 +109,7 @@
     union {
 	struct RNode *node;
 	ID id;
-	int argc;
+	intptr_t argc;
 	VALUE value;
     } u2;
     union {
@@ -278,8 +278,9 @@
 #define NEW_DEFINED(e) node_newnode(NODE_DEFINED,e,0,0)
 #define NEW_NEWLINE(n) node_newnode(NODE_NEWLINE,0,0,n)
 
-NODE *node_newnode();
-VALUE rb_method_booundp();
+NODE *node_newnode(enum node_type, NODE *,  NODE *,  NODE *);
+
+/* VALUE rb_method_booundp(); */
 
 #define NOEX_PUBLIC  0
 #define NOEX_PRIVATE 1
diff -ur ruby-1.0-971204/object.c ruby-1.0-971204-fix/object.c
--- ruby-1.0-971204/object.c	1997-09-16 16:25:03.000000000 +0900
+++ ruby-1.0-971204-fix/object.c	2025-12-02 12:21:05.011592432 +0900
@@ -18,7 +18,7 @@
 VALUE cObject;
 VALUE cModule;
 VALUE cClass;
-VALUE cFixnum;
+extern VALUE cFixnum;
 VALUE cData;
 
 static VALUE cNilClass;
diff -ur ruby-1.0-971204/parse.y ruby-1.0-971204-fix/parse.y
--- ruby-1.0-971204/parse.y	1997-11-25 12:39:07.000000000 +0900
+++ ruby-1.0-971204-fix/parse.y	2025-12-02 16:27:07.868096286 +0900
@@ -3243,7 +3243,7 @@
 {
     value_expr(left);
 
-    return node_newnode(type, cond(left), cond(right));
+    return node_newnode(type, cond(left), cond(right), 0);
 }
 
 st_table *new_idhash();
@@ -3505,7 +3505,7 @@
     char *name;
 {
     static ID last_id = LAST_TOKEN;
-    int id;
+    ID id;
     int last;
 
     if (st_lookup(sym_tbl, name, &id))
diff -ur ruby-1.0-971204/range.c ruby-1.0-971204-fix/range.c
--- ruby-1.0-971204/range.c	1997-11-10 10:24:01.000000000 +0900
+++ ruby-1.0-971204-fix/range.c	2025-12-02 11:29:20.885674168 +0900
@@ -12,7 +12,7 @@
 
 #include "ruby.h"
 
-VALUE mComparable;
+extern VALUE mComparable;
 static VALUE cRange;
 extern VALUE cNumeric;
 
diff -ur ruby-1.0-971204/ruby.h ruby-1.0-971204-fix/ruby.h
--- ruby-1.0-971204/ruby.h	1997-09-03 17:32:14.000000000 +0900
+++ ruby-1.0-971204-fix/ruby.h	2025-12-02 16:21:06.926928948 +0900
@@ -21,6 +21,11 @@
 # include <stdlib.h>
 #endif
 
+#ifdef __STDC__
+# include <stdint.h>
+# include <string.h>
+#endif
+
 #ifndef __STDC__
 # define volatile
 # ifdef __GNUC__
@@ -41,9 +46,9 @@
 #pragma alloca
 #endif
 
-typedef unsigned int UINT;
-typedef UINT VALUE;
-typedef UINT ID;
+typedef uintptr_t UINT;
+typedef uintptr_t VALUE;
+typedef uintptr_t ID;
 
 typedef unsigned short USHORT;
 typedef unsigned char UCHAR;
@@ -86,7 +91,7 @@
 #define FIX2INT(x) RSHIFT((int)x,1)
 
 #define FIX2UINT(f) ((UINT)(f)>>1)
-#define FIXNUM_P(f) (((int)(f))&FIXNUM_FLAG)
+#define FIXNUM_P(f) (((long)(f))&FIXNUM_FLAG)
 #define POSFIXABLE(f) ((f) <= FIXNUM_MAX)
 #define NEGFIXABLE(f) ((f) >= FIXNUM_MIN)
 #define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
@@ -148,6 +153,7 @@
 VALUE num2fix _((VALUE));
 int   num2int _((VALUE));
 
+struct RBasic *rb_newobj _((void));
 #define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
 #define OBJSETUP(obj,c,t) {\
     RBASIC(obj)->class = (c);\
@@ -324,15 +330,17 @@
 int rb_method_boundp _((VALUE,ID,int));
 
 VALUE rb_eval_string _((char*));
-VALUE rb_funcall();
-int rb_scan_args();
+VALUE rb_funcall(VALUE, ID, int, ...);
+VALUE rb_funcall2(VALUE, ID, int, VALUE *);
+int rb_scan_args(int, VALUE*, char*, ...);
 
-VALUE rb_iv_get();
-VALUE rb_iv_set();
+VALUE rb_iv_get(VALUE, char*);
+VALUE rb_iv_set(VALUE, char*, VALUE);
 void rb_const_set();
 VALUE rb_const_get();
 
-VALUE rb_yield();
+VALUE rb_yield_0(VALUE, volatile VALUE);
+VALUE rb_yield(VALUE);
 int iterator_p();
 
 VALUE rb_equal _((VALUE,VALUE));
@@ -342,24 +350,10 @@
 int rb_safe_level();
 void rb_set_safe_level _((int));
 
-#ifdef __GNUC__
-typedef void voidfn ();
-volatile voidfn Raise;
-volatile voidfn Fail;
-volatile voidfn Fatal;
-volatile voidfn Bug;
-volatile voidfn WrongType;
-volatile voidfn rb_sys_fail;
-volatile voidfn rb_break;
-volatile voidfn rb_exit;
-volatile voidfn rb_fatal;
-volatile voidfn rb_raise;
-volatile voidfn rb_notimplement;
-#else
-void Raise();
-void Fail();
-void Fatal();
-void Bug();
+void Raise(VALUE, char *, ...);
+void Fail(char *, ...);
+void Fatal(char *, ...);
+void Bug(char *, ...);
 void WrongType();
 void rb_sys_fail();
 void rb_break();
@@ -367,14 +361,65 @@
 void rb_fatal();
 void rb_raise();
 void rb_notimplement();
-#endif
-
-void Error();
-void Warning();
+void Error(char *, ...);
+void Warning(char *, ...);
 
 #if defined(EXTLIB) && defined(USE_DLN_A_OUT)
 /* hook for external modules */
 static char *libs_to_be_linked[] = { EXTLIB, 0 };
 #endif
 
+VALUE obj_alloc(VALUE);
+VALUE rb_inspect(VALUE);
+
+VALUE class_new(struct RClass *);
+void rb_name_class(VALUE, ID);
+VALUE singleton_class_new(struct RClass *);
+VALUE rb_singleton_class(struct RBasic *obj);
+
+VALUE rb_define_class_id(ID, struct RBasic *);
+VALUE rb_define_class(char *, VALUE);
+VALUE rb_define_class_under(VALUE, char *, VALUE);
+VALUE module_new();
+VALUE rb_define_module_id(ID);
+VALUE rb_define_module(char *);
+
+VALUE rb_iterate(VALUE (*)(), void *, VALUE (*)(), void *);
+
+VALUE str_new(UCHAR *, UINT);
+VALUE str_new2(UCHAR *);
+VALUE str_new3(struct RString *str);
+VALUE str_new4(struct RString *str);
+VALUE str_dup(struct RString *);
+VALUE str_cat(struct RString *, UCHAR *, UINT);
+VALUE str_taint(VALUE);
+VALUE str_tainted(VALUE);
+VALUE obj_as_string(VALUE);
+
+VALUE ary_new();
+VALUE ary_new2(int);
+VALUE ary_new3(int, ...);
+VALUE ary_new4(int, VALUE *);
+VALUE ary_push(struct RArray *, VALUE);
+VALUE ary_pop(struct RArray *);
+VALUE ary_shift(struct RArray *);
+VALUE ary_unshift(struct RArray *, int);
+VALUE ary_entry(struct RArray *, int);
+VALUE ary_join(struct RArray *, struct RString *);
+
+VALUE hash_new();
+VALUE hash_new2(VALUE);
+VALUE hash_aref(struct RHash *, VALUE);
+VALUE hash_aset(struct RHash *, VALUE, VALUE);
+
+VALUE range_new(VALUE, VALUE);
+
+VALUE file_open(char *, char *);
+VALUE io_getc(VALUE);
+VALUE io_gets(VALUE);
+
+VALUE exc_new(VALUE, char *, UINT);
+VALUE exc_new2(VALUE, char *);
+VALUE exc_new3(VALUE, struct RString *str);
+
 #endif
diff -ur ruby-1.0-971204/st.c ruby-1.0-971204-fix/st.c
--- ruby-1.0-971204/st.c	1997-09-03 17:32:14.000000000 +0900
+++ ruby-1.0-971204-fix/st.c	2025-12-02 13:26:52.799448733 +0900
@@ -4,6 +4,8 @@
 
 #include "config.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include "st.h"
 
 #define ST_DEFAULT_MAX_DENSITY 5
@@ -25,7 +27,6 @@
     numhash,
 };
 
-extern int strcmp();
 static int strhash();
 static struct st_hash_type type_strhash = {
     strcmp,
@@ -33,6 +34,7 @@
 };
 
 extern void *xmalloc();
+extern void *xcalloc();
 static void rehash();
 
 #define max(a,b) ((a) > (b) ? (a) : (b))
diff -ur ruby-1.0-971204/st.h ruby-1.0-971204-fix/st.h
--- ruby-1.0-971204/st.h	1997-05-22 11:27:21.000000000 +0900
+++ ruby-1.0-971204-fix/st.h	2025-12-02 14:03:50.474158191 +0900
@@ -32,12 +32,18 @@
 
 enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE};
 
-st_table *st_init_table();
-st_table *st_init_table_with_size();
+st_table *st_init_table(struct st_hash_type *);
+st_table *st_init_table_with_size(struct st_hash_type *, int);
 st_table *st_init_numtable();
 st_table *st_init_strtable();
-int st_delete(), st_insert(), st_foreach(), st_free_table();
-int st_lookup(), st_find_or_add(), st_add_direct();
+int st_delete(register st_table *, register char **, char **);
+int st_insert(register st_table *table, register char *key, char *);
+int st_foreach(st_table *table, enum st_retval (*)(), char *);
+int st_free_table(st_table *table);
+int st_lookup(st_table *table, register char *, char **);
+int st_find_or_add(st_table *, char *, char ***);
+int st_add_direct(st_table *, char *, char *);
+
 st_table *st_copy();
 
 #define ST_NUMCMP	((int (*)()) 0)
diff -ur ruby-1.0-971204/string.c ruby-1.0-971204-fix/string.c
--- ruby-1.0-971204/string.c	1997-12-04 13:44:18.000000000 +0900
+++ ruby-1.0-971204-fix/string.c	2025-12-02 15:47:54.623708466 +0900
@@ -13,6 +13,8 @@
 #include "ruby.h"
 #include "re.h"
 
+#include <crypt.h>
+
 #define BEG(no) regs->beg[no]
 #define END(no) regs->end[no]
 
@@ -25,8 +27,6 @@
 
 #define STR_FREEZE FL_USER1
 #define STR_TAINT  FL_USER2
-VALUE str_taint();
-VALUE str_tainted();
 
 VALUE
 str_new(ptr, len)
diff -ur ruby-1.0-971204/struct.c ruby-1.0-971204-fix/struct.c
--- ruby-1.0-971204/struct.c	1997-10-03 10:50:40.000000000 +0900
+++ ruby-1.0-971204-fix/struct.c	2025-12-02 11:19:24.747538834 +0900
@@ -13,6 +13,10 @@
 ID rb_frame_last_func();
 VALUE cStruct;
 extern VALUE mEnumerable;
+extern VALUE ary_new();
+extern VALUE ary_new2();
+extern VALUE ary_push();
+extern VALUE str_new2();
 
 static VALUE
 struct_s_members(obj)
@@ -155,12 +159,10 @@
     return nstr;
 }
 
-#include <varargs.h>
+#include <stdarg.h>
 
 VALUE
-struct_define(name, va_alist)
-    char *name;
-    va_dcl
+struct_define(char *name, ...)
 {
     va_list ar;
     VALUE nm, ary;
@@ -169,7 +171,7 @@
     nm = str_new2(name);
     ary = ary_new();
 
-    va_start(ar);
+    va_start(ar, name);
     while (mem = va_arg(ar, char*)) {
 	ID slot = rb_intern(mem);
 	ary_push(ary, INT2FIX(slot));
@@ -225,18 +227,16 @@
 }
 
 VALUE
-struct_new(class, va_alist)
-    VALUE class;
-    va_dcl
+struct_new(VALUE class, ...)
 {
     VALUE val, mem;
     int size;
     va_list args;
 
     val = rb_iv_get(class, "__size__");
-    size = FIX2INT(val); 
+    size = FIX2INT(val);
     mem = ary_new();
-    va_start(args);
+    va_start(args, class);
     while (size--) {
 	val = va_arg(args, VALUE);
 	ary_push(mem, val);
diff -ur ruby-1.0-971204/variable.c ruby-1.0-971204-fix/variable.c
--- ruby-1.0-971204/variable.c	1997-09-08 06:29:02.000000000 +0900
+++ ruby-1.0-971204-fix/variable.c	2025-12-02 14:11:33.644118503 +0900
@@ -129,7 +129,7 @@
 classname(class)
     VALUE class;
 {
-    VALUE path;
+    volatile VALUE path;
 
     while (TYPE(class) == T_ICLASS || FL_TEST(class, FL_SINGLETON)) {
 	class = (VALUE)RCLASS(class)->super;
@@ -156,7 +156,7 @@
 rb_class_path(class)
     VALUE class;
 {
-    VALUE path = classname(class);
+    volatile VALUE path = classname(class);
 
     if (path) return path;
     else {
@@ -660,7 +660,7 @@
       case T_CLASS:
       case T_MODULE:
 	if (obj->iv_tbl && st_lookup(obj->iv_tbl, id, &val))
-	    return val;
+	    return (VALUE)val;
 	return Qnil;
       default:
 	TypeError("class %s can not have instance variables",
