When run in verbose mode (either by setting
$VERBOSE=true or by running ruby with the -w flag), a
SWIG library emits the following warning when required:
mylibrary.so: warning: global variable
`$swig_runtime_data_type_pointer2' not initialized
The action that generates this warning is intentional.
The fact that the variable is not initialized tells
the SWIG module that it needs to initialize itself.
Silencing this warning can be achieved by temporarily
changing the $VERBOSE global in SWIG_Ruby_GetModule.
The following patch is from SWIG 1.3.27, applied to
diff . /rubydef.swg
< VALUE pointer;
> VALUE pointer, verbose;
> /* temporarily disable warnings, since the
pointer check causes warnings with 'ruby -w' */
> verbose = rb_gv_get("VERBOSE");
> rb_gv_set("VERBOSE", Qfalse);
> /* reinstate warnings */
> rb_gv_set("VERBOSE", verbose);
Log in to post a comment.