I am getting many many warnings of this kind in my code. It comes every time I typecast something in my code, which I am doing to variable addresses in order to use integer arithmetic on them. How do I fix these warnings? Thank you!


and warning is :

send_serv.c:78: warning: cast to pointer from integer of different size

char *c=(char *)lid2pstr(t->source,j.location_num,t->sourcef);

What exactly is "lid2pstr" returning? Without knowing, I would guess it returns something like a short or char. On 32-bit machines, pointers are (as far as I know) 4 bytes. Short is usually 2 bytes on x86 machines, and char is usually 1 byte.

return type of lid2pstr is character pointer. plz tell me the solution.

In that case then the compiler might be complaining about one of the parameters.

hi..

i amnot getting why the compiler should complain about one of the parameters.

neither do I but you have not posted enough code for anyone to figure it out. We need stuff like structure/class declarations and function prototypes.