|
From: | Brian Gough |
Subject: | Re: [Help-gsl] Gsl-1.8 compiled and running under MSYS-1.10+second order derivative |
Date: | Thu, 16 Nov 2006 17:53:03 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.6) Gecko/20060815 SeaMonkey/1.0.4 |
Rene Girard wrote:
gcc -O2 -Wall -ansi -I/usr/local/include -c -o t_dn2.o t_dn2.c t_dn2.c: In function ‘g_x’: t_dn2.c:61: warning: dereferencing ‘void *’ pointer t_dn2.c:61: error: void value not ignored as it ought to be
>
double g_x(double x, void *params) {const double pi = 4.0*atan(1.0); double yo,y1;yo = (sin(pi*x/2.0)*sin(pi*params[1]/2)); y1 = yo*yo;
With the prototype for g_x() above params[1] is an invalid expression, because params has void* type. Use something like double *p = params; then access elements as p[0], p[1] etc.
-- best regards, Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" http://www.network-theory.co.uk/gcc/
[Prev in Thread] | Current Thread | [Next in Thread] |