<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Oron Peled wrote:
<blockquote cite="mid:200907152252.22575.oron@actcom.co.il" type="cite">
<pre wrap="">On 15.07.2009 Shachar Shemesh wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The problem:
The following code segfaults:
printf("%s\n", inet_ntoa(addr) );
The cause: Failing to include the relevant header file.
The solution: Add:
#include <arpa/inet.h>
</pre>
</blockquote>
<pre wrap=""><!---->
Easier to catch during compile time: CFLAGS='-Wall -Werror'
This would fail the build because of missing prototypes.
</pre>
</blockquote>
You are, of course, right. The thing is, I usually use this function
(not thread safe etc.) only in tiny test programs, where I don't care
as much about warnings.<br>
<br>
Shachar<br>
<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>