This is the mail archive of the gcc-help@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]

RE: How do I resolve this warning


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]