If you rename your prototype of GJFullPivotInvert to GJFullPivotInvertD, you'll
get the warning on both... :)

double **ar != double ar[][].  Use the latter, and the warnings will stop,
except for the second arg in GJFullPivotInvertD().

const double ar[][] isn't a constant pointer, it's a pointer to a
multidimensional array of "const doubles".

On Mon, Jan 15, 2001 at 05:25:25PM -0800, Rhonda Frances Bailey wrote:
> hi all!
> 
> we have a program:
> 
> 
>       /* Prototypes */
>       void GJFullPivotInvert(int rank, const double **ar, double **target);
>       void PrintMatrixD(int rank, double **ar);
> 
>       #include<stdio.h>
>       int main(void)
>       {
>               double A[3][3] = {{1.0,2.0,3.0},{4.0,5.0,6.0},{7.0,8.0,9.0}};
>               double inverse[3][3];
> 
>               GJFullPivotInvertD(rank, A, inverse);
>               PrintMatrixD(3, inverse);
> 
>               return(0);
>       }
> 
> 
> inverse will be initialized in GJFullPivotInvertD.
> 
> gcc complains about the call to PrintMatrix, but not about the call to
> GJFullPivotInvertD().  here is the error:
> 
> example.c: In function `main':
> example.c:32: warning: passing arg 2 of `PrintMatrixD' from incompatible pointer type
> 
> can anyone shed light on this seeming inconsistency?
> 
> thanks,
> rhonda and pete
> 

Reply via email to