Bug#625323: collectd: ftbfs with gcc-4.6 -Werror
Hello Peter, On Thu, Aug 11, 2011 at 11:52:02PM +0100, peter green wrote: As well as the issue mentioned in this bug report I found two other issues that were preventing successfull build. thank you very much for your patch! I've committed the vast majority of it verbatim as http://octo.cx/61a1fa9. Here's what I changed: -buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh); +fgets (buffer, sizeof (buffer), global_read_fh); Leave the buffer_ptr in there and use it to write a warning when an unexpected EOF is read. Neither the current collectd-4.10 nor the collectd-5.0 branch compile without typename_len in src/plugin.c. I've dismissed this hunk completely. Thanks again :) —octo -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#625323: collectd: ftbfs with gcc-4.6 -Werror
On Thu, Aug 11, 2011 at 11:52:02PM +0100, peter green wrote: As well as the issue mentioned in this bug report I found two other issues that were preventing successfull build. Thanks for this! I'm not the maintainer of this package, but I think the patch attached to #614439 is a better fix for the 'struct xt_error_target' problem. diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/teamspeak2.c collectd-4.10.1/src/teamspeak2.c --- collectd-4.10.1~/src/teamspeak2.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/teamspeak2.c 2011-08-11 22:31:25.0 + @@ -296,9 +296,8 @@ { /* Check that the server correctly identifies itself. */ char buffer[4096]; - char *buffer_ptr; - buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh); + fgets (buffer, sizeof (buffer), global_read_fh); buffer[sizeof (buffer) - 1] = 0; if (memcmp ([TS]\r\n, buffer, 6) != 0) This causes a further build failure on Ubuntu where the toolchain defaults to -Werror=unused-result. Here's a patch to your patch to avoid this problem, and I've attached a complete amended gcc-4.6-fixes.dpatch. --- debian/patches/gcc-4.6-fixes.dpatch.orig2011-08-15 12:28:08.964134920 +0100 +++ debian/patches/gcc-4.6-fixes.dpatch 2011-08-15 11:55:35.0 +0100 @@ -264,14 +264,17 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/teamspeak2.c collectd-4.10.1/src/teamspeak2.c --- collectd-4.10.1~/src/teamspeak2.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/teamspeak2.c 2011-08-11 22:31:25.0 + -@@ -296,9 +296,8 @@ +@@ -296,9 +296,11 @@ { /* Check that the server correctly identifies itself. */ char buffer[4096]; - char *buffer_ptr; - buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh); -+ fgets (buffer, sizeof (buffer), global_read_fh); ++ if (fgets (buffer, sizeof (buffer), global_read_fh) == NULL) ++ { ++ /* We'll detect failures by inspecting the buffer. */ ++ } buffer[sizeof (buffer) - 1] = 0; if (memcmp ([TS]\r\n, buffer, 6) != 0) Thanks, -- Colin Watson [cjwat...@ubuntu.com] #! /bin/sh /usr/share/dpatch/dpatch-run ## gcc-4.6-fixes.dpatch by root@localhost ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: fixes for unused but set variable warnings from gcc-4.6 @DPATCH@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/disk.c collectd-4.10.1/src/disk.c --- collectd-4.10.1~/src/disk.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/disk.c 2011-08-11 22:31:25.0 + @@ -426,7 +426,6 @@ int numfields; int fieldshift = 0; - int major = 0; int minor = 0; counter_t read_sectors = 0; @@ -464,7 +463,6 @@ if ((numfields != (14 + fieldshift)) (numfields != 7)) continue; - major = atoll (fields[0]); minor = atoll (fields[1]); disk_name = fields[2 + fieldshift]; diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/java.c collectd-4.10.1/src/java.c --- collectd-4.10.1~/src/java.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/java.c 2011-08-11 22:31:25.0 + @@ -2253,7 +2253,6 @@ cjni_callback_info_t *cbi; jobject o_ocitem; const char *name; - int status; size_t i; jclass class; @@ -2308,7 +2307,7 @@ method = (*jvm_env)-GetMethodID (jvm_env, class, config, (Lorg/collectd/api/OConfigItem;)I); - status = (*jvm_env)-CallIntMethod (jvm_env, + (*jvm_env)-CallIntMethod (jvm_env, cbi-object, method, o_ocitem); (*jvm_env)-DeleteLocalRef (jvm_env, o_ocitem); @@ -3065,9 +3064,8 @@ if (config_block != NULL) { -int status; -status = cjni_config_perform (config_block); +cjni_config_perform (config_block); oconfig_free (config_block); config_block = NULL; } diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/libvirt.c collectd-4.10.1/src/libvirt.c --- collectd-4.10.1~/src/libvirt.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/libvirt.c 2011-08-11 22:31:25.0 + @@ -655,8 +655,6 @@ int i, n; const char *name; char uuid[VIR_UUID_STRING_BUFLEN]; -char
Bug#625323: collectd: ftbfs with gcc-4.6 -Werror
tags 625323 +patch thanks As well as the issue mentioned in this bug report I found two other issues that were preventing successfull build. Patches for all three issues and a new 00list file to apply them in the right order (the package uses dpatch) are attatched. Note that since I don't use collectd (i'm just doing flyby rc bug squashing) the functionality of the packages built with theese patches has not been tested. #! /bin/sh /usr/share/dpatch/dpatch-run ## gcc-4.6-fixes.dpatch by root@localhost ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: fixes for unused but set variable warnings from gcc-4.6 @DPATCH@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/disk.c collectd-4.10.1/src/disk.c --- collectd-4.10.1~/src/disk.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/disk.c 2011-08-11 22:31:25.0 + @@ -426,7 +426,6 @@ int numfields; int fieldshift = 0; - int major = 0; int minor = 0; counter_t read_sectors = 0; @@ -464,7 +463,6 @@ if ((numfields != (14 + fieldshift)) (numfields != 7)) continue; - major = atoll (fields[0]); minor = atoll (fields[1]); disk_name = fields[2 + fieldshift]; diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/java.c collectd-4.10.1/src/java.c --- collectd-4.10.1~/src/java.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/java.c 2011-08-11 22:31:25.0 + @@ -2253,7 +2253,6 @@ cjni_callback_info_t *cbi; jobject o_ocitem; const char *name; - int status; size_t i; jclass class; @@ -2308,7 +2307,7 @@ method = (*jvm_env)-GetMethodID (jvm_env, class, config, (Lorg/collectd/api/OConfigItem;)I); - status = (*jvm_env)-CallIntMethod (jvm_env, + (*jvm_env)-CallIntMethod (jvm_env, cbi-object, method, o_ocitem); (*jvm_env)-DeleteLocalRef (jvm_env, o_ocitem); @@ -3065,9 +3064,8 @@ if (config_block != NULL) { -int status; -status = cjni_config_perform (config_block); +cjni_config_perform (config_block); oconfig_free (config_block); config_block = NULL; } diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/libvirt.c collectd-4.10.1/src/libvirt.c --- collectd-4.10.1~/src/libvirt.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/libvirt.c 2011-08-11 22:31:25.0 + @@ -655,8 +655,6 @@ int i, n; const char *name; char uuid[VIR_UUID_STRING_BUFLEN]; -char *host_ptr; -size_t host_len; vl-time = t; vl-interval = interval_g; @@ -664,8 +662,6 @@ sstrncpy (vl-plugin, libvirt, sizeof (vl-plugin)); vl-host[0] = '\0'; -host_ptr = vl-host; -host_len = sizeof (vl-host); /* Construct the hostname field according to HostnameFormat. */ for (i = 0; i HF_MAX_FIELDS; ++i) { diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/match_empty_counter.c collectd-4.10.1/src/match_empty_counter.c --- collectd-4.10.1~/src/match_empty_counter.c 2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/match_empty_counter.c 2011-08-11 22:31:25.0 + @@ -73,7 +73,6 @@ const value_list_t *vl, notification_meta_t __attribute__((unused)) **meta, void **user_data) { - mec_match_t *m; int num_counters; int num_empty; int i; @@ -81,7 +80,6 @@ if ((user_data == NULL) || (*user_data == NULL)) return (-1); - m = *user_data; num_counters = 0; num_empty = 0; diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/mysql.c collectd-4.10.1/src/mysql.c --- collectd-4.10.1~/src/mysql.c2011-08-11 22:31:20.0 + +++ collectd-4.10.1/src/mysql.c 2011-08-11 22:31:25.0 + @@ -707,7 +707,6 @@ MYSQL_RES *res; MYSQL_ROW row; char *query; - intfield_num; unsigned long long qcache_hits = 0ULL; unsigned long long qcache_inserts = 0ULL; @@ -743,7 +742,7 @@ if (res == NULL) return (-1); - field_num = mysql_num_fields (res); + mysql_num_fields (res); while ((row = mysql_fetch_row (res))) { char *key; diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd-4.10.1~/src/network.c collectd-4.10.1/src/network.c --- collectd-4.10.1~/src/network.c
Bug#625323: collectd: ftbfs with gcc-4.6 -Werror
Hi The problem seems to be that libupsclient (since 2.6.0) does not provide the upscli_connect symbol anymore according to the config.log. Not sure if that's true, but if it is, it very probably is a bug in libupsclient (from source package nut). Cheers Luk -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#625323: collectd: ftbfs with gcc-4.6 -Werror
Hi Matthias, On Tue, May 03, 2011 at 10:32:36AM +, Matthias Klose wrote: This package builds with -Werror, and GCC 4.6 triggers new warnings which will make the package fail to build. The full build log can be found at: http://people.debian.org/~doko/tmp/werror/collectd_4.10.1-2.1_lsid64.buildlog the bulk of those problems reside in code that's generated by libtool (errors around checking dlopen) or autoconf (errors involving the ac_aggr variable). There are a couple or warnings which we can influence ourselves (the getmnt checking code) and I'll take a look, but I don't see how this should fail the build. In particular, I did not find any output of make, only that configure exited with status 1. Unfortunately, in that big dump of mostly useless data, I wasn't able to detect the output of configure before exiting with that status. Regards, --octo -- Florian octo Forster Hacker in training GnuPG: 0x0C705A15 http://octo.it/ signature.asc Description: Digital signature