From: Paul Brannan Date: 2001-10-25T22:49:12+09:00 Subject: [ruby-talk:23292] Re: () vs (...) in header files On Thu, 25 Oct 2001, ts wrote: > >>>>> "P" == Paul Brannan writes: > > P> Suggestions? > > Look at 1.7.* I thought I had looked at 1.7 in CVS before I started anything, but I just clicked on the top revision, which is 1.6... Anyhow, there are still some problems with 1.7. It uses a macro ANYARGS, which is ... for C++ and empty for C. This solves the problem of using g++ 3.0.1, but doesn't solve the safety issue. In particular: 1) rb_thread_select and rb_thread_wait_for take ANYARGS, but passing just any old arguments to these functions is likely to crash your program. I once had a case where I accidentally passed the wrong type for the timeval parameter, and it took me a while to figure out what was going on. Changing these to use the correct arguments in the header does not appear to break anything (at least in 1.6.5). 2) A less important issue, rb_define_method and friends take ANYARGS, but I don't think it's ever legal for these functions to ever take a method that doesn't have at least one VALUE parameter for self (so they should take VALUE(*)__(VALUE, ...). 3) I think there could be similar issues as #2 for rb_iterate, rb_rescue, etc. 4) rb_protect_inspect still takes a VALUE(*)(). Paul