This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: How do I resolve this warning
- From: "Rupert Wood" <me at rupey dot net>
- To: "'smac5'" <scott_mcdade at agilent dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Thu, 19 Jun 2008 08:10:31 +0100
- Subject: RE: How do I resolve this warning
- References: <17995432.post@talk.nabble.com>
smac5 wrote:
> ACME.c:227: warning: assignment makes integer from pointer without a
> cast
It's more or less what the warning says: you're storing the result of strstr() in an int whereas strstr() actually returns char*s. You only test the values you store in the ints against 0.
You should change the declaration of Tmmp1 and Tmmp2 to char* or const char*. That's probably enough, although I'd also change the tests
if (Tmmp1 == 0)
to
if (Tmmp1 == NULL)
too - but that's probably just style not correctness; I think the first form's actually valid too.
Hope that helps!
Rup.