Page MenuHome GnuPG

pinentry fails to build with GTK+ 2.12.9
Closed, ResolvedPublic

Description

Apparently some new symbols were introduced in GTK+ 2.12.9, which conflict with
pinentry 0.7.5, so it no longer builds:

cc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I../secmem -I../pinentry -Wall -g -Wall -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-pointer-sign -c
gtksecentry.c
In file included from /usr/include/gtk-2.0/gtk/gtkactiongroup.h:34,

from /usr/include/gtk-2.0/gtk/gtk.h:38,
from gtksecentry.c:40:

/usr/include/gtk-2.0/gtk/gtkitemfactory.h:50: warning: function declaration
isn't a prototype
gtksecentry.c:274: error: conflicting types for 'g_malloc'
/usr/include/glib-2.0/glib/gmem.h:47: error: previous declaration of 'g_malloc'
was here
gtksecentry.c:292: error: conflicting types for 'g_malloc0'
/usr/include/glib-2.0/glib/gmem.h:48: error: previous declaration
of 'g_malloc0' was here
gtksecentry.c:312: error: conflicting types for 'g_realloc'
/usr/include/glib-2.0/glib/gmem.h:50: error: previous declaration
of 'g_realloc' was here

Event Timeline

petere set External Link to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471613.
petere added a subscriber: petere.

[Simon McVittie sent the following comment to the Debian BTS.]

The minimal fix for this bug is likely to be to change the gulongs to gsizes in
the replacement functions for g_malloc, etc., so they match the signatures that
GLib wants.

However, a better solution IMO would be: instead of replacing GLib's normal
memory allocation via linker tricks, why not use g_mem_set_vtable() to set
GLib's memory allocation in the normal and documented way? You just need to
supply an implementation of malloc, realloc and free, which gtksecentry.c
already has. I've attached an untested patch.

marcus added a project: Restricted Project.Jun 19 2009, 1:06 AM

I put in a patch similar to that (g_malloc0 was now unnecessary, and I left in
the GMALLOC_SIZE macro). Thanks for taking the time to reporrt this.

marcus removed a project: Restricted Project.