l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2001 Dec 30 17:00

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] gcc inconsistency question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] gcc inconsistency question


  • Subject: Re: [vox-tech] gcc inconsistency question
  • From: Micah Cowan <micah@cowanboMAPSx.com>
  • Date: Mon, 15 Jan 2001 17:50:08 -0800
  • References: Pine.LNX.4.21.0101151724450.20944-100000@satan.diablo.localnet

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
> 


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!