Incorrect warning with gcc-2.96 but not g++-2.96
Charlie Zender
zender@uci.edu
Sat May 11 12:11:00 GMT 2002
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
More information about the Gcc-bugs
mailing list