This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Incorrect warning with gcc-2.96 but not g++-2.96
- From: Charlie Zender <zender at uci dot edu>
- To: GCC bugs <bug-gcc at gnu dot org>
- Date: Sat, 11 May 2002 12:10:47 -0700
- Subject: Incorrect warning with gcc-2.96 but not g++-2.96
- Reply-to: Charlie Zender <zender at uci dot edu>
The following program produces a warning with gcc-2.96
void fnc(const int argc,const char * const * const argv)
{
}
int main(int argc,char* argv[])
{
fnc(argc,argv);
return 0;
}
The warning is
zender@lanina:~/c$ gcc -o bug bug.c
bug.c: In function `main':
bug.c:10: warning: passing arg 2 of `fnc' from incompatible pointer type
As far as I can tell this is legal code and does not produce warnings
with other compilers. g++ version 2.96 does not produce a warning
either. So maybe it is a C/C++ distinction I do not understand.
Charlie
--
Charlie Zender zender@uci.edu (949) 824-2987/FAX-3256, Department of
Earth System Science, University of California, Irvine CA 92697-3100