Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Peter Montgomery
Thu, 22 Sep 1988 04:11
Incorrect warning about incompatible arguments
Author: Peter Montgomery
Date: Thu, 22 Sep 1988 04:11
Date: Thu, 22 Sep 1988 04:11
17 lines
950 bytes
950 bytes
/*
On a SUN 3 at OS 4.0, GCC 1.28 warns "argument passing between
incompatible pointer types" for the call to mat_print. The warning does
not appear if "const" is omitted from the declaration of mat_print. GCC
1.26 did not give this warning. The object code is correct, with or
without optimization.
*/
void mat_print(const int mat[2][2]) {
printf("Matrix elements are %d %d %d %d\n", mat[0][0], mat[0][1],
mat[1][0], mat[1][1]);
}
main()
{
int a[2][2] = {10, 20, 30, 40};
mat_print(a);
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads