[collectd] Compiling on HP-UX

Florian Forster octo at verplant.org
Mon Nov 6 20:37:01 CET 2006


Hi again :)

On Mon, Nov 06, 2006 at 01:44:34PM -0500, Jeff Haney wrote:
> Thanks octo, I didn't realize you had made any changes. It got past 
> that point but got another error further on, see below.

No problem, good to know that it works as expected :)

> I attached the full output of my configure and compile.  Again, your
> help is very much appreciated.
> 
> network.c: In function 'network_receive':
> network.c:428: warning: passing argument 6 of 'recvfrom' from 
>   incompatible pointer type

Great. That's why I love standards in general and UNIX in particular:
The sixth argument, named `fromlen' is an `int *' under HP-UX (and,
according to the glibc's manpage `recv(2)', 4.x BSD, libc4 and libc5)
but it is a `socklen_t *', according to some POSIX specification. And,
because someone felt funny, the `getaddrinfo' and `getnameinfo'
functions use `size_t' for this, which usually doesn't fit into an int
on 64bit machines. Here, the glibc and HP-UX agree - but the arguments
are of type `socklen_t' according to Stevens' APUE[*].

If I simply change the `fromlen' argument to `int' on my machine
(GNU/Linux) I get the following compiler-error:
-- 8< --
 network.c: In function 'network_receive':
 network.c:428: warning: pointer targets in passing argument 6 of
   'recvfrom' differ in signedness
-- >8 --

So, apparently we need some more autoconf checks to handle this madness.
Could you, for now, change the declaration of the `addrlen' variable
(file `src/network.c', line 412) from `socklen_t' to `int' and see if
that works?

Regards,
-octo

[*] <http://www.kohala.com/start/apue.html>
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20061106/71873755/attachment.pgp


More information about the collectd mailing list