in reply to Re: Passing NULL pointer through XS without "Use of uninitialized value in subroutine entry"
in thread Passing NULL pointer through XS without "Use of uninitialized value in subroutine entry"
which successfully avoids the warning message I was getting originally. Unfortunately, this is one of those bits of code someone else wrote originally and didn't write tests for, so now I need to go and actually write some tests to make sure this works right.struct bar* create_event(foo_sv) SV* foo_sv struct type_foo* foo = NULL; CODE: if ( SvROK(foo_sv)) { SV *tmp = (SV*) SvRV(foo_sv); if ( SvOK (tmp)) { foo = (struct type_foo*) SvIV(tmp); } } else { warn( "Foo::create_bar() -- foo is not an SV reference" ); XSRETURN_UNDEF; } RETVAL = my_c_create_bar(foo); OUTPUT: RETVAL
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Passing NULL pointer through XS without "Use of uninitialized value in subroutine entry"
by ikegami (Patriarch) on Aug 22, 2006 at 23:33 UTC | |
by kscaldef (Pilgrim) on Aug 23, 2006 at 17:15 UTC | |
by ikegami (Patriarch) on Aug 23, 2006 at 18:06 UTC |