Bug#266298: balsa: FTBFS (amd64/gcc-3.4): unsigned int format, different type arg

Andreas Jochens Andreas Jochens <aj@andaco.de>, 266298@bugs.debian.org
Tue, 17 Aug 2004 14:43:00 +0200


Package: balsa
Severity: normal
Tags: patch

When building 'balsa' with gcc-3.4 on amd64 I get the following error:

if cc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../../libbalsa -I../../libmutt -I../../libmutt -I../../libbalsa/imap -DORBIT2=1 -pthread -DXTHREADS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgnome-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/include/gnome-vfs-module-2.0 -I/usr/include/gmime-2.0   -DXTHREADS -I/usr/include/libgnomeprint-2.2 -I/usr/include/libart-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/libgnomeprintui-2.2 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0   -DXTHREADS -DORBIT2=1 -pthread -I/usr/include/libgtkhtml-3.1 -I/usr/include/gtk-2.0 -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnomeprint-2.2 -I/usr/include/libgnomeprintui-2.2 -I/usr/include/libglade-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2     -I/usr/include    -ansi -Werror -g -Wall -O2 -Wsign-compare -Wpointer-arith -Wnested-externs -Wchar-subscripts -Wuninitialized -Wmissing-prototypes -Wreturn-type -MT imap-commands.o -MD -MP -MF ".deps/imap-commands.Tpo" -c -o imap-commands.o imap-commands.c; \
then mv -f ".deps/imap-commands.Tpo" ".deps/imap-commands.Po"; else rm -f ".deps/imap-commands.Tpo"; exit 1; fi
imap-commands.c: In function `imap_mbox_append':
imap-commands.c:435: warning: unsigned int format, different type arg (arg 4)
imap-commands.c:438: warning: unsigned int format, different type arg (arg 3)
make[4]: *** [imap-commands.o] Error 1
make[4]: Leaving directory `/balsa-2.2.2/libbalsa/imap'

With the attached patch 'balsa' can be compiled using gcc-3.4 on amd64.

Regards
Andreas Jochens

diff -urN ../tmp-orig/balsa-2.2.2/libbalsa/imap/imap-commands.c ./libbalsa/imap/imap-commands.c
--- ../tmp-orig/balsa-2.2.2/libbalsa/imap/imap-commands.c	2004-08-04 13:17:13.000000000 +0200
+++ ./libbalsa/imap/imap-commands.c	2004-08-17 14:28:59.290575377 +0200
@@ -432,10 +432,10 @@
 
   if(flags) {
     gchar *str = enum_flag_to_str(flags);
-    cmd = g_strdup_printf("APPEND \"%s\" (%s) {%u%s}", mbx7, str, sz, litstr);
+    cmd = g_strdup_printf("APPEND \"%s\" (%s) {%u%s}", mbx7, str, (unsigned) sz, litstr);
     g_free(str);
   } else 
-    cmd = g_strdup_printf("APPEND \"%s\" {%u%s}", mbx7, sz, litstr);
+    cmd = g_strdup_printf("APPEND \"%s\" {%u%s}", mbx7, (unsigned) sz, litstr);
 
   c = imap_cmd_start(handle, cmd, &cmdno);
   g_free(mbx7); g_free(cmd);
diff -urN ../tmp-orig/balsa-2.2.2/libbalsa/imap/imap-search.c ./libbalsa/imap/imap-search.c
--- ../tmp-orig/balsa-2.2.2/libbalsa/imap/imap-search.c	2004-07-29 16:34:28.000000000 +0200
+++ ./libbalsa/imap/imap-search.c	2004-08-17 14:29:43.329880385 +0200
@@ -215,7 +215,7 @@
      life! */
   if(use_literal)
     sio_printf(handle->sio, "{%u+}\r\n%s",
-               strlen(k->d.string.s), k->d.string.s);
+               (unsigned) strlen(k->d.string.s), k->d.string.s);
   else { /* No literal+ suppport, do it the old way */
     for (s = k->d.string.s; *s && (*s & 0x80) == 0; s++)
       ;
@@ -274,8 +274,8 @@
 static void
 imap_write_key_size(ImapMboxHandle *handle, gboolean negate, size_t size)
 {
-  if(negate) sio_printf(handle->sio, "NOT LARGER %u", size);
-  else       sio_printf(handle->sio, "LARGER %u", size);
+  if(negate) sio_printf(handle->sio, "NOT LARGER %u", (unsigned) size);
+  else       sio_printf(handle->sio, "LARGER %u", (unsigned) size);
 }
 
 /* private.  */