-1

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);
3
Contributors
6
Replies
9
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

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.

0

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

Edited by ashwinikuma: n/a

0

hi..

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.