Date: Fri, 24 Jun 94 02:49:31 EDT To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Problem with 'const' From: K3A0270 AT EMAIL1 DOT edvz DOT uni-linz DOT ac DOT at (Exler Roland) Reply-To: K3A0270 AT ALIJKU11 DOT edvz DOT uni-linz DOT ac DOT at Hi all, the program appended to this message compiles fine as .cc, but as .c! I think it's a bug of the c-compiler. (I'm using djgpp 1.11m5) If anyone can show me a declaration of 'testfunc' where any manipulation of the pointers or data will be checked by the compiler and without the obvious (const float**)-cast is Ok with C, please send it to me Thanks for any suggestions, Roland *********** start of program 'test.c'=='test.cc' ************************ #include #include #define collen 10 #define matlen 20 float **mptr; /* pointer to array of pointer to array of float */ void testfunc(const float *const *const mat) { /* just for test, should generate 3 warnings */ mat++; mat[0]++; mat[0][0]++; } int main(void) { int i; int j; /* get memory for array of pointer to array of float */ mptr=(float **) malloc(sizeof(float)*matlen); for (i=0; i