RE: How do I resolve this warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux