Re: Smoking out C extension mistakes


#1

P> You could use:
P> if(foo == Qnil)
P> instead of using the NIL_P macro.

#define NIL_P(v) ((VALUE)(v) == Qnil)

:slight_smile:

Guy Decoux

So, is there a way to catch my mistake or not Guy?

  • Dan

#2

β€œB” == Berger, Daniel removed_email_address@domain.invalid writes:

B> So, is there a way to catch my mistake or not Guy?

You can’t have a problem with NIL_P(), it just use ==

But you can have problems with other macros, like

RSTRING(str)

str must be a valid struct RString, otherwise just expect that ruby
crash when it use the result :slight_smile:

Guy Decoux