NetBSD-Users archive

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

Re: inet_ntoa error on NetBSD-4.0 amd64



On Thu, Mar 06, 2008 at 08:51:08PM +0800, Water NB wrote:
> I know I included an incorrect .h file.
> But I don't understand:
> why inet_ntoa return a bad address?

It does not - you did not have a proper declaration, so the function is
assumed to return int. This fails on everything where sizeof(int) !=
sizeof(pointer).

Gcc tells you (with -Wall):

test.c: In function 'main':
test.c:14: warning: implicit declaration of function 'inet_ntoa'
test.c:14: warning: assignment makes pointer from integer without a cast


Martin


Home | Main Index | Thread Index | Old Index