Mail Archives: djgpp/1998/04/26/14:15:17
Hi,
This is a simplified version of a code I wrote for learning purposes:
main (int argc, char *argv[])
{
if (argc==2)
{
if (strcmp(strupr(argv[1]),"/H")==0)
{
help();
return0;
}
else
do_other_stuff();
}
return 0;
}
The compiler (gcc) gives this "Warning: passing arg 1 of `strcmp' makes
pointer from integer without a cast."
Why? Since 'strupr()' returns a string (not an integer) there is no reason
for this warning. The code gets compiled and works fine, but I am puzzled.
Any clues?
Best regards,
Thiago
- Raw text -