FTBFS with GCC 4.4: missing #include

Bug #492163 reported by Alfonso Cepeda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gloox (Debian)
Fix Released
Unknown
gloox (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

GCC 4.4 cleaned up some more C++ headers. You always have to #include
headers directly and cannot rely for things to be included indirectly.

Therefore to fix the following error

> md5.cpp: In member function 'const std::string gloox::MD5::hex()':
> md5.cpp:440: error: 'sprintf' was not declared in this scope
> make[4]: *** [md5.lo] Error 1

you have to add the #include <stdio.h> directive

Patch submitted by Martin Michlmayr <email address hidden> in debian:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505333

Tags: ftbfs

Related branches

Revision history for this message
Alfonso Cepeda (cepeda) wrote :

Added a debdiff file with the patch

Note that it has already been submitted to debian in bug 505333

Changed in gloox (Debian):
status: Unknown → New
Revision history for this message
Michael Bienia (geser) wrote :

For C++ please use "#include <cstdio>" instead of "#include <stdio.h>" as you can also see in the Debian bug you linked.

Changed in gloox (Ubuntu):
status: New → Incomplete
Revision history for this message
Alfonso Cepeda (cepeda) wrote : Re: [Bug 492163] Re: FTBFS with GCC 4.4: missing #include

Sorry, I did the patch by myself, and then I notice it had already
been done in debian by Martin Michlmayr. I gave credit to him because
he had released it before but I didn't notice it was a little
different.

Anyway AFAIK both ways can be used in C++, with the difference that if
you use <cstdio>, functions are in std namespace.

Is it recommended to use the cstdio library or is it just a decision
of the programmer?

Thanks.

I include the new debdiff file.

Revision history for this message
Michael Bienia (geser) wrote :

Thanks for your contribution. Uploaded (after fixing some minor typos and updating the Maintainer field).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gloox - 0.9.9.5-1.2ubuntu1

---------------
gloox (0.9.9.5-1.2ubuntu1) lucid; urgency=low

  * [FTBFS] Added #include <cstdio> to use sprintf (LP: #492163)
    Fix submitted by Martin Michlmayr.
 -- Alfonso Cepeda Caballos <email address hidden> Fri, 04 Dec 2009 06:24:28 +0000

Changed in gloox (Ubuntu):
status: Incomplete → Fix Released
Changed in gloox (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.