[En-Nut-Discussion] u_long inet_addr(CONST char * str) returns -1

José Vallet jose.vallet at hut.fi
Thu Nov 13 12:15:51 CET 2008


Hello all.

I have noticed that the definition of the inet_ntoa function (line 172 
of file inet.c) goes like this.

u_long inet_addr(CONST char * str)
{
  ...
  return -1;
}

To me this looks weird, as the value to be returned is supposed to be 
unsigned. So I guess I am missing something. Does this mean that the 
returned value will be 2^32-1 and that is supposed to be the value 
returned when error?

And shouldn't the compiler complain about this?

Thanks!
José


More information about the En-Nut-Discussion mailing list