rih5342
Marine/Ocean
- May 8, 2007
- 40
I'm using Windows-7 64bit, with gcc V5.2, with MinGW, and trying to compile portablexdr-4.9.1
This piece of C
static bool_t
xdrmem_setpos(xdrs, pos)
register XDR *xdrs;
u_int pos;
{
register caddr_t newaddr = xdrs->x_base + pos;
register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
if ((long)newaddr > (long)lastaddr) <== error here
return (FALSE);
xdrs->x_private = newaddr;
xdrs->x_handy = lastaddr - newaddr;
return (TRUE);
}
produces this error
xdr_mem.c: In function 'xdrmem_setpos':
xdr_mem.c:172:6: error: cast from pointer to integer of different size [-Werror=
pointer-to-int-cast]
if ((long)newaddr > (long)lastaddr)
^
xdr_mem.c:172:22: error: cast from pointer to integer of different size [-Werror
=pointer-to-int-cast]
if ((long)newaddr > (long)lastaddr)
How do I fix it?
Thank you.
This piece of C
static bool_t
xdrmem_setpos(xdrs, pos)
register XDR *xdrs;
u_int pos;
{
register caddr_t newaddr = xdrs->x_base + pos;
register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
if ((long)newaddr > (long)lastaddr) <== error here
return (FALSE);
xdrs->x_private = newaddr;
xdrs->x_handy = lastaddr - newaddr;
return (TRUE);
}
produces this error
xdr_mem.c: In function 'xdrmem_setpos':
xdr_mem.c:172:6: error: cast from pointer to integer of different size [-Werror=
pointer-to-int-cast]
if ((long)newaddr > (long)lastaddr)
^
xdr_mem.c:172:22: error: cast from pointer to integer of different size [-Werror
=pointer-to-int-cast]
if ((long)newaddr > (long)lastaddr)
How do I fix it?
Thank you.