Debian Bug report logs - #488132
aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'

version graph

Package: aptitude; Maintainer for aptitude is Aptitude Development Team <aptitude-devel@lists.alioth.debian.org>; Source for aptitude is src:aptitude.

Reported by: Kurt Roeckx <kurt@roeckx.be>

Date: Thu, 26 Jun 2008 16:54:01 UTC

Severity: serious

Tags: patch

Found in version aptitude/0.4.11.6-1

Fixed in version aptitude/0.4.11.7-1

Done: Daniel Burrows <dburrows@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Daniel Burrows <dburrows@debian.org>:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
New Bug report received and forwarded. Copy sent to Daniel Burrows <dburrows@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Kurt Roeckx <kurt@roeckx.be>
To: submit@bugs.debian.org
Subject: aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Date: Thu, 26 Jun 2008 18:53:22 +0200
Package: aptitude
Version: 0.4.11.6-1
Severity: serious

Hi,

Your package is failing to build on some arches with the following
error:
cmdline_resolver.cc:239: error: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'

Guessing based on the affected arches you want to print a size_t.  You
need a %zd for that.


Kurt





Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Daniel Burrows <dburrows@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #10 received at 488132@bugs.debian.org (full text, mbox):

From: Daniel Burrows <dburrows@debian.org>
To: Kurt Roeckx <kurt@roeckx.be>, 488132@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Date: Thu, 26 Jun 2008 19:27:03 -0700
On Thu, Jun 26, 2008 at 06:53:22PM +0200, Kurt Roeckx <kurt@roeckx.be> was heard to say:
> Package: aptitude
> Version: 0.4.11.6-1
> Severity: serious
> 
> Hi,
> 
> Your package is failing to build on some arches with the following
> error:
> cmdline_resolver.cc:239: error: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
> 
> Guessing based on the affected arches you want to print a size_t.  You
> need a %zd for that.

  It's even more fun: it's a std::vector<T>::size_type, which AFAIK can
be defined to be any unsigned integer type.  Since I know this value
will always be small (it represents the number of archives in which a
package can be found), it's probably easier and more portable to
explicitly cast it to an int.

  Daniel




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Daniel Burrows <dburrows@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #15 received at 488132@bugs.debian.org (full text, mbox):

From: Daniel Burrows <dburrows@debian.org>
To: Kurt Roeckx <kurt@roeckx.be>, 488132@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Date: Thu, 26 Jun 2008 19:33:40 -0700
  Which architectures besides amd64 are failing?  I'd like to verify the
fix, but there doesn't seem to be an amd64 emulator in the archive...
and it looks like everything else succeeded.

  Daniel




Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Burrows <dburrows@debian.org>:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
Extra info received and forwarded to list. Copy sent to Daniel Burrows <dburrows@debian.org>. Full text and rfc822 format available.

Message #20 received at 488132@bugs.debian.org (full text, mbox):

From: Kurt Roeckx <kurt@roeckx.be>
To: Daniel Burrows <dburrows@debian.org>
Cc: 488132@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Date: Fri, 27 Jun 2008 08:32:34 +0200
On Thu, Jun 26, 2008 at 07:33:40PM -0700, Daniel Burrows wrote:
>   Which architectures besides amd64 are failing?  I'd like to verify the
> fix, but there doesn't seem to be an amd64 emulator in the archive...
> and it looks like everything else succeeded.

alpha, ia64 and s390.

You know there are porter machines you can log into?


Kurt





Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Daniel Burrows <dburrows@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #25 received at 488132@bugs.debian.org (full text, mbox):

From: Daniel Burrows <dburrows@debian.org>
To: Kurt Roeckx <kurt@roeckx.be>, 488132@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Date: Fri, 27 Jun 2008 06:07:41 -0700
On Fri, Jun 27, 2008 at 08:32:34AM +0200, Kurt Roeckx <kurt@roeckx.be> was heard to say:
> On Thu, Jun 26, 2008 at 07:33:40PM -0700, Daniel Burrows wrote:
> >   Which architectures besides amd64 are failing?  I'd like to verify the
> > fix, but there doesn't seem to be an amd64 emulator in the archive...
> > and it looks like everything else succeeded.
> 
> alpha, ia64 and s390.
> 
> You know there are porter machines you can log into?

  Yes, but my experience in the past was that they never have the
development packages I need for whatever I'm working on.  I suppose
they're worth a try, though.

  Daniel




Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Burrows <dburrows@debian.org>:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to peter green <plugwash@p10link.net>:
Extra info received and forwarded to list. Copy sent to Daniel Burrows <dburrows@debian.org>. Full text and rfc822 format available.

Message #30 received at 488132@bugs.debian.org (full text, mbox):

From: peter green <plugwash@p10link.net>
To: "dburrows "@debian.org
Cc: "488132 "@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int',, but argument 2 has type 'long unsigned int'
Date: Fri, 27 Jun 2008 19:13:50 +0100
[Message part 1 (text/plain, inline)]
tags 488132 +patch
thanks

DO NOT SEND THIS MESSAGE YET

>I'd like to verify the
>fix, but there doesn't seem to be an amd64 emulator in the archive...


I have added int casts to all the printf calls the compiler was 
complaining about and the package now builds.

patch is attatched

BTW in the qemu package I see

/usr/bin/qemu-system-x86_64
/usr/bin/qemu-x86_64

But I imagine they will be pretty slow.


[aptitude-intcasts.diff (text/x-diff, inline)]
diff -ur aptitude-0.4.11.6/src/cmdline/cmdline_resolver.cc aptitude-0.4.11.6-new/src/cmdline/cmdline_resolver.cc
--- aptitude-0.4.11.6/src/cmdline/cmdline_resolver.cc	2008-06-11 02:26:49.000000000 +0000
+++ aptitude-0.4.11.6-new/src/cmdline/cmdline_resolver.cc	2008-06-27 17:09:36.000000000 +0000
@@ -236,7 +236,7 @@
 
   for(vector<pkgCache::VerIterator>::size_type i = 0;
       i < choices.size(); ++i)
-    cout << ssprintf(" (%d) %s", i+1, archives_text(choices[i]).c_str()) << endl;
+    cout << ssprintf(" (%d) %s", (int)(i+1), archives_text(choices[i]).c_str()) << endl;
 
   while(1)
     {
@@ -247,7 +247,7 @@
       in >> ws >> i >> ws;
 
       if(!in || !in.eof() || i < 1 || i > (signed)choices.size())
-	cerr << ssprintf(_("Invalid response.  Please enter an integer between 1 and %d."), choices.size()) << endl;
+	cerr << ssprintf(_("Invalid response.  Please enter an integer between 1 and %d."), (int)choices.size()) << endl;
       else
 	return choices[i];
     }
@@ -561,8 +561,8 @@
 	  resolver_manager::state state = resman->state_snapshot();
 
 	  spin.set_msg(ssprintf(_("open: %d; closed: %d; defer: %d; conflict: %d"),
-				state.open_size, state.closed_size,
-				state.deferred_size, state.conflicts_size));
+				(int)(state.open_size), (int)(state.closed_size),
+				(int)(state.deferred_size), (int)(state.conflicts_size)));
 	  spin.display();
 	  spin.tick();
 	}
diff -ur aptitude-0.4.11.6/src/cmdline/cmdline_util.cc aptitude-0.4.11.6-new/src/cmdline/cmdline_util.cc
--- aptitude-0.4.11.6/src/cmdline/cmdline_util.cc	2008-06-21 17:29:21.000000000 +0000
+++ aptitude-0.4.11.6-new/src/cmdline/cmdline_util.cc	2008-06-27 17:13:45.000000000 +0000
@@ -342,7 +342,7 @@
 	output_fragments.push_back(cw::text_fragment(ssprintf(ngettext("There is %d newly obsolete package.",
 								       "There are %d newly obsolete packages.",
 								       new_obsolete.size()),
-							      new_obsolete.size())));
+							      (int)new_obsolete.size())));
       }
     else if(new_obsolete.size() > 0)
       {

Tags added: patch Request was from peter green <plugwash@p10link.net> to control@bugs.debian.org. (Fri, 27 Jun 2008 18:21:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Burrows <dburrows@debian.org>:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to peter green <plugwash@p10link.net>:
Extra info received and forwarded to list. Copy sent to Daniel Burrows <dburrows@debian.org>. Full text and rfc822 format available.

Message #37 received at 488132@bugs.debian.org (full text, mbox):

From: peter green <plugwash@p10link.net>
To: "dburrows "@debian.org
Cc: "488132 "@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int',, but argument 2 has type 'long unsigned int'
Date: Fri, 27 Jun 2008 20:26:01 +0100
>
> DO NOT SEND THIS MESSAGE YET

Sorry that was a note to myself that I forgot to delete when the message 
was finally ready for sending.




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#488132; Package aptitude. Full text and rfc822 format available.

Acknowledgement sent to Daniel Burrows <dburrows@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #42 received at 488132@bugs.debian.org (full text, mbox):

From: Daniel Burrows <dburrows@debian.org>
To: peter green <plugwash@p10link.net>, 488132@bugs.debian.org
Subject: Re: Bug#488132: aptitude: FTBFS: format '%d' expects type 'int', , but argument 2 has type 'long unsigned int'
Date: Fri, 27 Jun 2008 20:53:32 -0700
On Fri, Jun 27, 2008 at 07:13:50PM +0100, peter green <plugwash@p10link.net> was heard to say:
> tags 488132 +patch
> thanks
>
> DO NOT SEND THIS MESSAGE YET
>
>> I'd like to verify the
>> fix, but there doesn't seem to be an amd64 emulator in the archive...
>
>
> I have added int casts to all the printf calls the compiler was  
> complaining about and the package now builds.

  Ah, thanks -- that's why I wanted to check (I only knew about the
first one, so the fix didn't fix it).

> patch is attatched
>
> BTW in the qemu package I see
>
> /usr/bin/qemu-system-x86_64
> /usr/bin/qemu-x86_64
>
> But I imagine they will be pretty slow.

  I'm fine with slow for this purpose.  I actually checked qemu, but its
package description said it doesn't have an emulator for x86_64 (or
rather, that it only has them for powerpc, sparc, and x86).  I'll file a
bug about that.

>    for(vector<pkgCache::VerIterator>::size_type i = 0;
>        i < choices.size(); ++i)
> -    cout << ssprintf(" (%d) %s", i+1, archives_text(choices[i]).c_str()) << endl;
> +    cout << ssprintf(" (%d) %s", (int)(i+1), archives_text(choices[i]).c_str()) << endl;

  That one I fixed already.

> -	cerr << ssprintf(_("Invalid response.  Please enter an integer between 1 and %d."), choices.size()) << endl;
> +	cerr << ssprintf(_("Invalid response.  Please enter an integer between 1 and %d."), (int)choices.size()) << endl;

  This is fine since the choices list will always be less than the
largest possible int ;-).

>        else
>  	return choices[i];
>      }
> @@ -561,8 +561,8 @@
>  	  resolver_manager::state state = resman->state_snapshot();
>  
>  	  spin.set_msg(ssprintf(_("open: %d; closed: %d; defer: %d; conflict: %d"),
> -				state.open_size, state.closed_size,
> -				state.deferred_size, state.conflicts_size));
> +				(int)(state.open_size), (int)(state.closed_size),
> +				(int)(state.deferred_size), (int)(state.conflicts_size)));

  Again, the number of search nodes examined should be less than the
largest possible int, so this is ok.  OTOH, these guys are *actually*
size_t values, so maybe I'll consider using %zd instead.

>  	output_fragments.push_back(cw::text_fragment(ssprintf(ngettext("There is %d newly obsolete package.",
>  								       "There are %d newly obsolete packages.",
>  								       new_obsolete.size()),
> -							      new_obsolete.size())));
> +							      (int)new_obsolete.size())));

  I expect that less than 1<<31 packages will be obsolete, so this will
work.

    Thanks,
  Daniel




Reply sent to Daniel Burrows <dburrows@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Kurt Roeckx <kurt@roeckx.be>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #47 received at 488132-close@bugs.debian.org (full text, mbox):

From: Daniel Burrows <dburrows@debian.org>
To: 488132-close@bugs.debian.org
Subject: Bug#488132: fixed in aptitude 0.4.11.7-1
Date: Sat, 28 Jun 2008 21:02:04 +0000
Source: aptitude
Source-Version: 0.4.11.7-1

We believe that the bug you reported is fixed in the latest version of
aptitude, which is due to be installed in the Debian FTP archive:

aptitude-dbg_0.4.11.7-1_i386.deb
  to pool/main/a/aptitude/aptitude-dbg_0.4.11.7-1_i386.deb
aptitude-doc-cs_0.4.11.7-1_all.deb
  to pool/main/a/aptitude/aptitude-doc-cs_0.4.11.7-1_all.deb
aptitude-doc-en_0.4.11.7-1_all.deb
  to pool/main/a/aptitude/aptitude-doc-en_0.4.11.7-1_all.deb
aptitude-doc-fi_0.4.11.7-1_all.deb
  to pool/main/a/aptitude/aptitude-doc-fi_0.4.11.7-1_all.deb
aptitude-doc-fr_0.4.11.7-1_all.deb
  to pool/main/a/aptitude/aptitude-doc-fr_0.4.11.7-1_all.deb
aptitude-doc-ja_0.4.11.7-1_all.deb
  to pool/main/a/aptitude/aptitude-doc-ja_0.4.11.7-1_all.deb
aptitude_0.4.11.7-1.diff.gz
  to pool/main/a/aptitude/aptitude_0.4.11.7-1.diff.gz
aptitude_0.4.11.7-1.dsc
  to pool/main/a/aptitude/aptitude_0.4.11.7-1.dsc
aptitude_0.4.11.7-1_i386.deb
  to pool/main/a/aptitude/aptitude_0.4.11.7-1_i386.deb
aptitude_0.4.11.7.orig.tar.gz
  to pool/main/a/aptitude/aptitude_0.4.11.7.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 488132@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Burrows <dburrows@debian.org> (supplier of updated aptitude package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 28 Jun 2008 13:02:52 -0700
Source: aptitude
Binary: aptitude aptitude-dbg aptitude-doc-cs aptitude-doc-en aptitude-doc-fi aptitude-doc-fr aptitude-doc-ja
Architecture: source all i386
Version: 0.4.11.7-1
Distribution: unstable
Urgency: low
Maintainer: Daniel Burrows <dburrows@debian.org>
Changed-By: Daniel Burrows <dburrows@debian.org>
Description: 
 aptitude   - terminal-based package manager
 aptitude-dbg - Debug symbols for the aptitude package manager
 aptitude-doc-cs - Czech manual for aptitude, a terminal-based package manager
 aptitude-doc-en - English manual for aptitude, a terminal-based package manager
 aptitude-doc-fi - Finnish manual for aptitude, a terminal-based package manager
 aptitude-doc-fr - French manual for aptitude, a terminal-based package manager
 aptitude-doc-ja - Japanese manual for aptitude, a terminal-based package manager
Closes: 482094 488132
Changes: 
 aptitude (0.4.11.7-1) unstable; urgency=low
 .
   * New upstream release.
 .
     - Fix FTBFSes. (Closes: #488132)
 .
     - Translation updates:
       + Basque
       + Portuguese (Closes: #482094)
       + Thai
Checksums-Sha1: 
 6dd449babed278d1e21d2024f08299a144c5a1eb 1391 aptitude_0.4.11.7-1.dsc
 35388196fffe5b4dc713f7c671ae8b5a20aca965 5737847 aptitude_0.4.11.7.orig.tar.gz
 a8d6423fc0a4fe9527816170837cc58d94bc3b5a 34936 aptitude_0.4.11.7-1.diff.gz
 593f762b95aad8ff5ec8d11eecd04bb7f79a12e1 345272 aptitude-doc-cs_0.4.11.7-1_all.deb
 182c8c73491e978fa0e41ff9318d7e6df7b8b62b 353378 aptitude-doc-en_0.4.11.7-1_all.deb
 49a793f841c3986a7a3d5d123af75ffd27cf61c0 263704 aptitude-doc-fi_0.4.11.7-1_all.deb
 4c168daae4da289d08e055f1a0636c28a0ffa8f8 298184 aptitude-doc-fr_0.4.11.7-1_all.deb
 416b9bbcf66864bc8ddba0608dc561c3de1bad75 363754 aptitude-doc-ja_0.4.11.7-1_all.deb
 84ab05d7edd38217ea0ed3864fcecbe6117b45b1 2788258 aptitude_0.4.11.7-1_i386.deb
 b82356eacf52d983cae260b19df127512cb5b33a 5902598 aptitude-dbg_0.4.11.7-1_i386.deb
Checksums-Sha256: 
 27f2f6b91e3bf1641ea92adc850e77e57f4e92c19a1e485fa9a61ec350338526 1391 aptitude_0.4.11.7-1.dsc
 f0902e20f8330863927a677608de2380d3695f7da79ac7bd7e6a177d1a07005e 5737847 aptitude_0.4.11.7.orig.tar.gz
 dcd7e411562da1603cf971748c7cab8c4b300d531a094534c990a80ebf63383e 34936 aptitude_0.4.11.7-1.diff.gz
 105b6b0e9c0fd2a23a8d0679fab1d41c3546132da2b35db594883d098f45b862 345272 aptitude-doc-cs_0.4.11.7-1_all.deb
 8ad2a712be87ad674b68a412519dc0e54eb0967de97a9216099a783ec601fb5e 353378 aptitude-doc-en_0.4.11.7-1_all.deb
 ebfa0e08ab31c179cdd51d38dda912c65fac9b2e99f48afc2ef54cdd8e17a808 263704 aptitude-doc-fi_0.4.11.7-1_all.deb
 08325e0c482118dab6f3ea573406278500b8c189f352329117d9b5c88b30d35c 298184 aptitude-doc-fr_0.4.11.7-1_all.deb
 928abcd5a0c68b358c1b3cbc8b11d78b7481dcdaa26f06e84559526cb9bde54a 363754 aptitude-doc-ja_0.4.11.7-1_all.deb
 63ef920247c95afc6c44f27c325421615cf8d06eab1ff7c5b8f3f82689df99a2 2788258 aptitude_0.4.11.7-1_i386.deb
 bd1eb8a608f1daf18848960e83a8be31032c1b1f8cfd4177b84a7678fd025b93 5902598 aptitude-dbg_0.4.11.7-1_i386.deb
Files: 
 0d8f7febea10b585b53aee1bc0c7c032 1391 admin - aptitude_0.4.11.7-1.dsc
 bee1229a40eb4644f1e263fc9b5ad567 5737847 admin - aptitude_0.4.11.7.orig.tar.gz
 a022f14ace04848933e6f7047f0a2811 34936 admin - aptitude_0.4.11.7-1.diff.gz
 eb3fe4bb6d0a24e4f8da7592a1630529 345272 doc optional aptitude-doc-cs_0.4.11.7-1_all.deb
 3cca0b321c4e1ffd2f55cbb4fa77f73f 353378 doc optional aptitude-doc-en_0.4.11.7-1_all.deb
 64b525ffbe005cc39e365e4d81be16b5 263704 doc optional aptitude-doc-fi_0.4.11.7-1_all.deb
 2aab19b8b462b5ca9c359ec334398d3c 298184 doc optional aptitude-doc-fr_0.4.11.7-1_all.deb
 11f1a59487f21482fb1df403b6e15b96 363754 doc optional aptitude-doc-ja_0.4.11.7-1_all.deb
 45df663b782ef29dcbe0dbf5f2475dc7 2788258 admin important aptitude_0.4.11.7-1_i386.deb
 c5a8ec7e9adc869ef0a9702a603399fb 5902598 devel extra aptitude-dbg_0.4.11.7-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIZqLich6xsM7kSXgRAhMAAJ99LnRcqNGPQN7CatYcF1hxEpisxACfVJYj
3A1CQX7j020HdgbWwqf0L9k=
=Smmx
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 31 Jul 2008 07:31:12 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 23 11:06:42 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.