Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

pinentry - unproper use of glib allocation

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


uzytkownik2 at gmail

Feb 17, 2008, 2:50 AM

Post #1 of 5 (686 views)
Permalink
pinentry - unproper use of glib allocation

With the newest glib it is impossible to compile pinentry:
i686-pc-linux-gnu-gcc -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 -O2
-march=pentium-m -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb -w
-ftree-vectorize -ftree-loop-optimize -Wall -Wcast-align -Wshadow
-Wstrict-prototypes -c gtksecentry.c
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

Since the gmem api was misused. It should be done by setting
GMemVTable instead of definition of g_*alloc* in file.

Best regards

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


uzytkownik2 at gmail

Feb 17, 2008, 5:14 AM

Post #2 of 5 (658 views)
Permalink
Re: pinentry - unproper use of glib allocation [In reply to]

On Feb 17, 2008 1:47 PM, Maciej Piechotka <uzytkownik2 [at] gmail> wrote:
>
> On Feb 17, 2008 11:50 AM, Maciej Piechotka <uzytkownik2 [at] gmail> wrote:
> > With the newest glib it is impossible to compile pinentry:
> > i686-pc-linux-gnu-gcc -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 -O2
> > -march=pentium-m -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb -w
> > -ftree-vectorize -ftree-loop-optimize -Wall -Wcast-align -Wshadow
> > -Wstrict-prototypes -c gtksecentry.c
> > 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
> >
> > Since the gmem api was misused. It should be done by setting
> > GMemVTable instead of definition of g_*alloc* in file.
> >
> > Best regards
> >
>
> Quick'n'dirty patch - all gobjects in secure memory.
>

I think this emulates the orginal behaviour using GMemVTable.

Best regards
Attachments: gmem.patch (2.78 KB)


wk at gnupg

Feb 18, 2008, 7:40 AM

Post #3 of 5 (656 views)
Permalink
Re: pinentry - unproper use of glib allocation [In reply to]

On Sun, 17 Feb 2008 11:50, uzytkownik2 [at] gmail said:

> Since the gmem api was misused. It should be done by setting
> GMemVTable instead of definition of g_*alloc* in file.

That seems to be an API break. Overiding library function, as done by
pinentry, is valid C. Do you know since when is GMemVTable available?


Shalom-Salam,

Werner


--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


uzytkownik2 at gmail

Feb 18, 2008, 11:26 AM

Post #4 of 5 (654 views)
Permalink
Re: pinentry - unproper use of glib allocation [In reply to]

On Feb 18, 2008 4:40 PM, Werner Koch <wk [at] gnupg> wrote:
> On Sun, 17 Feb 2008 11:50, uzytkownik2 [at] gmail said:
>
> > Since the gmem api was misused. It should be done by setting
> > GMemVTable instead of definition of g_*alloc* in file.
>
> That seems to be an API break. Overiding library function, as done by
> pinentry, is valid C. Do you know since when is GMemVTable available?
>
>
> Shalom-Salam,
>
> Werner
>

At least since GLib 2.0.0 (according to svn and documentation).

Regards

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


wk at gnupg

Feb 18, 2008, 11:16 PM

Post #5 of 5 (651 views)
Permalink
Re: pinentry - unproper use of glib allocation [In reply to]

On Mon, 18 Feb 2008 20:26, uzytkownik2 [at] gmail said:

> At least since GLib 2.0.0 (according to svn and documentation).

Thanks. I'll commit your patch.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.