From: "Berger, Daniel" Date: 2003-10-08T22:37:48+09:00 Subject: rb_scan_args question Hi all, 2nd attempt - the ML appeared to be defunct yesterday. Ruby 1.8 Windows XP Pro VC++ 7 I'm noticing, in Windows at least (not sure about other platforms), some odd behavior with rb_scan_args. Let's say I have this function: static VALUE foo(int argc, VALUE *argv) { VALUE arg1, arg2; rb_scan_args(argc,argv,"12",&arg1,&arg2); return Qnil; } What I've noticed is that sometimes this causes a segfault. Sometimes rather bizarre behavior occurs. The workaround seems to be to add a 3rd VALUE so that the call looks like this: rb_scan_args(argc,argv,"12",&arg1,&arg2,&rest); But, I don't understand why I need the 3rd argument. The "12" states a minimum of 1 arg and a maximum of 2 args. So, why do I need the 3rd VALUE? Please clarify. Regards, Dan