Build error #42

Closed
aixtal opened this Issue Jan 24, 2013 · 3 comments

2 participants

@aixtal

Build fails ( Mac OSx 10.8.2, gcc 4.6.3, swig 2.0.9) :

xs/Roots_wrap.1.15.c:3283:7: error: void function '_wrap_gsl_root_fdfs
+olver_fdf_set' should not return a value [-Wreturn-type]
      return (gsl_nan());
      ^      ~~~~~~~~~~~

...

xs/Roots_wrap.1.15.c:3840:7: error: void function '_wrap_gsl_root_fdfs
+olver_set' should not return a value [-Wreturn-type]
      return (gsl_nan());
      ^      ~~~~~~~~~~~

Same problem was reported here a long time ago on other systems, therefore it doesn't seem to be an OSx specific problem.

http://www.perlmonks.org/?node_id=891521

Thanks for your help.

@aixtal

A quick response by Rob on Perlmonks http://www.perlmonks.org/index.pl?node_id=1015131 opened my eyes. the two returns above should be XSRETURN. I made the changes in the version from the CPAN tarball and the build succeeded.

I intended to make a pull request here, but the .c files are not included in the xs directory (am I missing something?).

@leto
Owner

Thanks for reporting this @aixtal . The *.c files are all autogenerated by SWIG from the corresponding *.i files in the swig/ directory. SWIG is only required for developers using the Git repo. If you download a CPAN tarball, all the files are already generated and "end users" just compile the appropriate XS code for their version of GSL.

I believe the bug comes from here:

https://github.com/leto/math--gsl/blob/master/swig/gsl_typemaps.i#L600

Note that GSL_NAN is a macro that expands to (gsl_nan()) .

I just fixed that in 93cc517 . Please let me know how that works for you!

@aixtal

Great! All tests pass. Many thanks.

@aixtal aixtal closed this Jan 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment