Ticket #3054 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

mutt-1.5.17: inconsistent format strings in debug output of rfc3676.c

Reported by: m-a Owned by: mutt-dev
Priority: minor Milestone: 1.6
Component: mutt Version: 1.5.17
Keywords: Cc:

Description

Package: mutt
Version: 1.5.17
Severity: normal

-- Please type your report below this line
rfc3676.c causes gcc 4.1.2 complaints since %ld is used to print size_t
type arguments. The patch included below casts these arguments to long
to avoid issues on platforms where sizeof(long) != sizeof(size_t).

This is generated with hg export:

# HG changeset patch
# User Matthias Andree <matthias.andree@gmx.de>
# Date 1210495963 -7200
# Branch HEAD
# Node ID 09b0363cdf54c414fc7a94b8034ea67b242ab439
# Parent  98c39c5187a957c12ee99a0d7322634723f1e866
In debug output, cast size_t arguments to long for consistency with
printf %ld argument.

diff -r 98c39c5187a9 -r 09b0363cdf54 rfc3676.c
--- a/rfc3676.c	Sun May 11 00:50:31 2008 -0700
+++ b/rfc3676.c	Sun May 11 10:52:43 2008 +0200
@@ -101,16 +101,16 @@
 
   width = quote_width (s, ql);
 
-  dprint (4, (debugfile, "f-f: line [%s], width = %ld\n", NONULL(line), width));
+  dprint (4, (debugfile, "f-f: line [%s], width = %ld\n", NONULL(line), (long)width));
 
   for (p = (char *)line, words = 0; (p = strsep (&line, " ")) != NULL ; )
   {
     w = mutt_strwidth (NONULL(p));
-    dprint (4, (debugfile, "f-f: word [%s], width = %ld, line = %ld\n", NONULL(p), w, *sofar));
+    dprint (4, (debugfile, "f-f: word [%s], width = %ld, line = %ld\n", NONULL(p), (long)w, (long)*sofar));
     if (w + 1 + (*sofar) > width)
     {
       /* line would be too long, flush */
-      dprint (4, (debugfile, "f-f: width: %ld\n", *sofar));
+      dprint (4, (debugfile, "f-f: width: %ld\n", (long)*sofar));
       state_puts (" \n", s);
       *sofar = 0;
     }


-- System Information
System Version: Linux merlin 2.6.18.8-0.9-default #1 SMP Sun Feb 10 22:48:05 UTC 2008 i686 athlon i386 GNU/Linux
SuSE Release: openSUSE 10.2 (i586)

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
gcc
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix=-4.1 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)

- CFLAGS
-Wall -pedantic -g -O2

-- Mutt Version Information

Mutt 1.5.17 (2008-05-05)
Copyright (C) 1996-2008 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.18.8-0.9-default (i686)
ncurses: ncurses 5.5.20060513 (compiled with 5.5)
libidn: 0.6.8 (compiled with 0.1.14)
hcache backend: qdbm 1.8.75
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK   
+USE_POP  +USE_IMAP  -USE_SMTP  +USE_GSS  +USE_SSL_OPENSSL  -USE_SSL_GNUTLS  +USE_SASL  +HAVE_GETADDRINFO  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  +CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/local/share/mutt"
SYSCONFDIR="/usr/local/etc"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please visit http://bugs.mutt.org/.

Attachments

mutt-5370-hg.patch (1.2 kB) - added by m-a 6 months ago.
Same patch as inline with the report, for convenience.

Change History

Changed 6 months ago by m-a

Same patch as inline with the report, for convenience.

Changed 6 months ago by m-a

  • priority changed from major to minor
  • version set to 1.5.17
  • milestone set to 1.6

Changed 6 months ago by brendan

  • status changed from new to closed
  • resolution set to fixed

Applied in [09b0363cdf54], thanks

Note: See TracTickets for help on using tickets.