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.000000000 +0000
> +++ collectd-4.10.1/src/teamspeak2.c  2011-08-11 22:31:25.000000000 +0000
> @@ -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.orig    2011-08-15 12:28:08.964134920 
+0100
+++ debian/patches/gcc-4.6-fixes.dpatch 2011-08-15 11:55:35.000000000 +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.000000000 +0000
 +++ collectd-4.10.1/src/teamspeak2.c   2011-08-11 22:31:25.000000000 +0000
-@@ -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.000000000 +0000
+++ collectd-4.10.1/src/disk.c  2011-08-11 22:31:25.000000000 +0000
@@ -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.000000000 +0000
+++ collectd-4.10.1/src/java.c  2011-08-11 22:31:25.000000000 +0000
@@ -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.000000000 +0000
+++ collectd-4.10.1/src/libvirt.c       2011-08-11 22:31:25.000000000 +0000
@@ -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.000000000 
+0000
+++ collectd-4.10.1/src/match_empty_counter.c   2011-08-11 22:31:25.000000000 
+0000
@@ -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.c        2011-08-11 22:31:20.000000000 +0000
+++ collectd-4.10.1/src/mysql.c 2011-08-11 22:31:25.000000000 +0000
@@ -707,7 +707,6 @@
        MYSQL_RES *res;
        MYSQL_ROW  row;
        char      *query;
-       int        field_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      2011-08-11 22:31:20.000000000 +0000
+++ collectd-4.10.1/src/network.c       2011-08-11 22:31:25.000000000 +0000
@@ -787,7 +787,6 @@
        size_t exp_size = 2 * sizeof (uint16_t) + sizeof (uint64_t);
 
        uint16_t pkg_length;
-       uint16_t pkg_type;
 
        if ((buffer_len < 0) || ((size_t) buffer_len < exp_size))
        {
@@ -801,7 +800,6 @@
 
        memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
        buffer += sizeof (tmp16);
-       pkg_type = ntohs (tmp16);
 
        memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
        buffer += sizeof (tmp16);
@@ -827,7 +825,6 @@
        size_t header_size = 2 * sizeof (uint16_t);
 
        uint16_t pkg_length;
-       uint16_t pkg_type;
 
        if ((buffer_len < 0) || (buffer_len < header_size))
        {
@@ -841,7 +838,6 @@
 
        memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
        buffer += sizeof (tmp16);
-       pkg_type = ntohs (tmp16);
 
        memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
        buffer += sizeof (tmp16);
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' 
'--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
collectd-4.10.1~/src/notify_email.c collectd-4.10.1/src/notify_email.c
--- collectd-4.10.1~/src/notify_email.c 2011-08-11 22:31:24.000000000 +0000
+++ collectd-4.10.1/src/notify_email.c  2011-08-11 22:31:25.000000000 +0000
@@ -228,7 +228,6 @@
 static int notify_email_notification (const notification_t *n,
     user_data_t __attribute__((unused)) *user_data)
 {
-  smtp_recipient_t recipient;
 
   struct tm timestamp_tm;
   char timestamp_str[64];
@@ -288,7 +287,7 @@
   smtp_set_message_str (message, buf);
 
   for (i = 0; i < recipients_len; i++)
-    recipient = smtp_add_recipient (message, recipients[i]);
+    smtp_add_recipient (message, recipients[i]);
 
   /* Initiate a connection to the SMTP server and transfer the message. */
   if (!smtp_start_session (session)) {
@@ -298,11 +297,16 @@
     pthread_mutex_unlock (&session_lock);
     return (-1);
   } else {
-    const smtp_status_t *status;
-    /* Report on the success or otherwise of the mail transfer. */
-    status = smtp_message_transfer_status (message);
-    DEBUG ("notify_email plugin: SMTP server report: %d %s",
+    #if COLLECT_DEBUG
+      const smtp_status_t *status;
+      /* Report on the success or otherwise of the mail transfer. */
+      status = smtp_message_transfer_status (message);
+      DEBUG ("notify_email plugin: SMTP server report: %d %s",
         status->code, (status->text != NULL) ? status->text : "\n");
+    #else
+      //I don't know if the function below has side affects so i'm calling it 
to be on the safe side.
+      smtp_message_transfer_status (message);
+    #endif
     smtp_enumerate_recipients (message, print_recipient_status, NULL);
   }
 
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' 
'--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
collectd-4.10.1~/src/owniptc/libiptc.c collectd-4.10.1/src/owniptc/libiptc.c
--- collectd-4.10.1~/src/owniptc/libiptc.c      2011-08-11 22:31:24.000000000 
+0000
+++ collectd-4.10.1/src/owniptc/libiptc.c       2011-08-11 22:31:25.000000000 
+0000
@@ -555,7 +555,7 @@
  */
 static int iptcc_chain_index_delete_chain(struct chain_head *c, TC_HANDLE_T h)
 {
-       struct list_head *index_ptr, *index_ptr2, *next;
+       struct list_head *index_ptr, *next;
        struct chain_head *c2;
        unsigned int idx, idx2;
 
@@ -575,7 +575,7 @@
                 * is located in the same index bucket.
                 */
                c2         = list_entry(next, struct chain_head, list);
-               index_ptr2 = iptcc_bsearch_chain_index(c2->name, &idx2, h);
+               iptcc_bsearch_chain_index(c2->name, &idx2, h);
                if (idx != idx2) {
                        /* Rebuild needed */
                        return iptcc_chain_index_rebuild(h);
@@ -1198,10 +1198,8 @@
 static TC_HANDLE_T
 alloc_handle(const char *tablename, unsigned int size, unsigned int num_rules)
 {
-       size_t len;
        TC_HANDLE_T h;
 
-       len = sizeof(STRUCT_TC_HANDLE) + size;
 
        h = malloc(sizeof(STRUCT_TC_HANDLE));
        if (!h) {
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' 
'--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
collectd-4.10.1~/src/plugin.c collectd-4.10.1/src/plugin.c
--- collectd-4.10.1~/src/plugin.c       2011-08-11 22:31:24.000000000 +0000
+++ collectd-4.10.1/src/plugin.c        2011-08-11 22:32:31.000000000 +0000
@@ -582,7 +582,6 @@
        const char *dir;
        char  filename[BUFSIZE] = "";
        char  typename[BUFSIZE];
-       int   typename_len;
        int   ret;
        struct stat    statbuf;
        struct dirent *de;
@@ -601,7 +600,6 @@
                WARNING ("snprintf: truncated: `%s.so'", type);
                return (-1);
        }
-       typename_len = strlen (typename);
 
        if ((dh = opendir (dir)) == NULL)
        {
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' 
'--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
collectd-4.10.1~/src/processes.c collectd-4.10.1/src/processes.c
--- collectd-4.10.1~/src/processes.c    2011-08-11 22:31:20.000000000 +0000
+++ collectd-4.10.1/src/processes.c     2011-08-11 22:31:25.000000000 +0000
@@ -871,7 +871,6 @@
 
        int   i;
 
-       int   ppid;
        int   name_len;
 
        long long unsigned cpu_user_counter;
@@ -909,7 +908,6 @@
        fields[1][name_len] = '\0';
        strncpy (ps->name, fields[1], PROCSTAT_NAME_LEN);
 
-       ppid = atoi (fields[3]);
 
        *state = fields[2][0];
 
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.000000000 +0000
+++ collectd-4.10.1/src/teamspeak2.c    2011-08-11 22:31:25.000000000 +0000
@@ -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);
+               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)
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' 
'--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
collectd-4.10.1~/src/utils_dns.c collectd-4.10.1/src/utils_dns.c
--- collectd-4.10.1~/src/utils_dns.c    2011-08-11 22:31:20.000000000 +0000
+++ collectd-4.10.1/src/utils_dns.c     2011-08-11 22:31:25.000000000 +0000
@@ -432,7 +432,6 @@
     int nexthdr;
 
     struct in6_addr s_addr;
-    struct in6_addr d_addr;
     uint16_t payload_len;
 
     if (0 > len)
@@ -441,7 +440,6 @@
     offset = sizeof (struct ip6_hdr);
     nexthdr = ipv6->ip6_nxt;
     s_addr = ipv6->ip6_src;
-    d_addr = ipv6->ip6_dst;
     payload_len = ntohs (ipv6->ip6_plen);
 
     if (ignore_list_match (&s_addr))

Reply via email to