Rene Girard wrote:

double g1(double, double *);

I would like to bring to your attention that when I
compile that simple example and
I set the pointer to the function from we want to have
the derivative with the following
statement:
f.function = &g1; (like in the example in Chap. 27)

I get the following warning:

"warning: assignment from incompatible pointer type"

to remove the warning I had to cast the pointer as
follow:

 f.function = (double (*) ()) &g1;

Hello,
Thanks for your email. I think your warning can be avoided without a cast by using the prototype double g1(double, void *) which matches the definition in GSL. Otherwise, the appropriate cast would be (double (*)(double, void *)). See the header file gsl_math.h for the definition of the gsl_function type.

--
best regards,

Brian Gough
(GSL Maintainer)

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/


_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to