[Spice-devel] [patch] Add missing format string in SpiceController::~SpiceController()

Christophe Fergeau cfergeau at redhat.com
Thu Jan 2 03:11:11 PST 2014


Hey Petter,

On Fri, Dec 27, 2013 at 08:18:11AM +0100, Petter Reinholdtsen wrote:
> The Debian package of spice-xpi failed to build on powerpc and sparc in
> Debian, failing with this error message:
> 
>   make[6]: Entering directory `/«PKGBUILDDIR»/SpiceXPI/src/plugin'
>     CXX    libnsISpicec_la-controller.lo
>   controller.cpp: In destructor 'SpiceController::~SpiceController()':
>   controller.cpp:73:5: error: format not a string literal and no format
>     arguments [-Werror=format-security]
>   cc1plus: some warnings being treated as errors
> 
> The error is in a call to g_debug, and this patch fixes the problem:

Hmm, G_STRFUNC should expand to __PRETTY_FUNC or something similar, so the
compiler should be able to figure out it's a constant string/harmless
string. I haven't been able to reproduce on a ppc box after adding -Wformat
-Werror=format-security to the build flags :( Could be that I built with a
different glib version (glib2 2.36.3) or gcc version (gcc 4.8.2).
With that said, the patch is small enough that I'm fine with taking it.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140102/ed77374f/attachment.pgp>


More information about the Spice-devel mailing list