rb_time_new() change in 1.8.2?

D

daz

Daniel said:
Hi all,

Contrary to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/2725,
rb_time_new() will accept a single argument in 1.8.1 and assume 0 as
the second argument.

It isn't contrary. In the same thread, Nobu explained why the
prototype _was_ defined without arguments. Consequently, your
compiler is informed that the number of args is unspecified.
As Matz has said, the function has always taken two args. If you
only provided one, the second would be read from next slot on the
CPU stack (whatever happened to be there at that moment).
However, testing with 1.8.2 RC2 reveals that the second argument is
now mandatory. Is this intentional?

Because the updated prototype allows your compiler to flag the error.


daz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,338
Messages
2,571,773
Members
48,572
Latest member
Lenard07G0

Latest Threads

Top