This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC 2.95.1 Bug Report
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: GCC 2.95.1 Bug Report
- From: "Conner, Mike (M.C.)" <mconner3 at visteon dot com>
- Date: Tue, 5 Oct 1999 12:15:35 -0400
- Cc: "'mconner at acm dot org'" <mconner at acm dot org>
To whom it concerns,
I recently updgraded from DJGPP GCC v2.7.2 to DJGPP GCC v2.95.1 and noticed
a new warning that I believe to be incorrect.
The compiler appears to be complaining about decreasing pointer capability
across a function call. However, the compiler does not issue it
consistently. There are two examples that illustrate this point below.
Note the warning goes away if the const keyword is removed from foo1 or
added to the declaration of bar1.
The compiler command line is as follows:
gcc -c main.c
The compiler message is as follows:
main.c: In function `main':
main.c:12: warning: passing arg 1 of `foo1' from incompatible pointer type
The source code for main.c is as follows:
#include <stdlib.h>
static void foo1 (const unsigned char bar[4][3]);
static void foo2 (const unsigned char bar[4]);
int
main (void)
{
unsigned char bar1[4][3];
unsigned char bar2[4];
foo1 (bar1);
foo2 (bar2);
return EXIT_SUCCESS;
}
static void
foo1 (const unsigned char bar[4][3])
{
}
static void
foo2 (const unsigned char bar[4])
{
}
-- Mike Conner, Software Engineer
-- Visteon Driver Information Core Engineering
-- Phone: 313.845.4371 Fax: 313.337.1278
-- mailto:mconner3@visteon.com (Visteon business only)
-- mailto:mconner@acm.org (all other business)