[collectd] 3.9.0 build issues..
Sebastian Harl
sh at tokkee.org
Wed Apr 19 08:55:35 CEST 2006
> > collectd.c: In function `pidfile_create':
> > collectd.c:259: warning: int format, pid_t arg (arg 3)
>
> I get a similar warning on AMD64:
>
> hddtemp.c: In function `hddtemp_init':
> hddtemp.c:349: warning: unsigned int format, different type arg (arg 3)
Seems like AMD64 requires some more explicit casts. The following patch fixed
that problem for me.
--- collectd-3.9.0.orig/src/hddtemp.c
+++ collectd-3.9.0/src/hddtemp.c
@@ -346,7 +346,7 @@
if ((entry = (hddname_t *) malloc (sizeof (hddname_t)))
== NULL)
{
- syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL",
sizeof (hddname_t));
+ syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL",
(unsigned int) sizeof (hddname_t));
free (name);
continue;
}
--- collectd-3.9.0.orig/src/common.c
+++ collectd-3.9.0/src/common.c
@@ -488,7 +488,7 @@
/* The `%.*s' is needed because there is no null-byte behind
* the name. */
- fprintf(log, ",%.*s", (tmp - name), name);
+ fprintf(log, ",%.*s", (int) (tmp - name), name);
}
fprintf(log, "\n");
fclose(log);
I guess you need to change line 259 in src/collectd.c to look like this:
fprintf (fh, "%d\n", (int) getpid());
... to fix your problem. There will probably be some more places where you
have to add some more casts.
HTH,
Sebastian
--
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.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/20060419/89d622fb/attachment.pgp
More information about the collectd
mailing list