This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Incorrect warning with gcc-2.96 but not g++-2.96


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]