cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/26/14:15:17

Message-Id: <3.0.5.32.19980426151354.007c65b0@200.252.238.1>
Date: Sun, 26 Apr 1998 15:13:54 -0300
To: djgpp AT delorie DOT com
From: "Thiago F.G. Albuquerque" <thiagofga AT ambr DOT com DOT br>
Subject: strcmp: "makes pointer from integer without a cast"
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019