On Sun, 14 Jan 2007 03:55:45 -0800
Steve Langasek <[EMAIL PROTECTED]> wrote:

> On Sat, Jan 13, 2007 at 09:26:13PM -0800, Thomas Bushnell BSG wrote:
> > Hi Steve; you were very helpful with the last alpha bug reported by this
> > submitter; I'm wondering if you can give it a little attention.  I don't
> > have easy access to an alpha to reproduce the problem.
>
> Please ask upstream where they got the idea that g_type_register_static()
> returned a guint, or that it was otherwise ok to cast its GType return type
> to a guint.

This behaviour has been "normal" for gnucash for at least 5 years. The
only "reason" I can find is from the API docs for glib2:
"GType
A numerical value which represents the unique identifier of a
registered type. "
http://developer.gnome.org/doc/API/2.0/gobject/gobject-Type-Information.html#GType

I guess it's just being taken literally and in the absence of a warning
not to . . .

The use of guint predates the use of g_type_register_static, to a time
when gtk_type_unique was in use:
http://svn.gnucash.org/trac/changeset/12075#file1

But the static guint type existed before that and has not been changed
since:
http://svn.gnucash.org/trac/browser/gnucash/trunk/src/business/business-gnome/search-owner.c?rev=6905#L65

> Years of debugging crashing gtk+ programs on alpha, and it's
> always the same thing -- somehow, GTK programmers are consistently getting
> bad information about how to use gobject, and I want to know where it's
> coming from so I can lart the people responsible.

I can't find a URL for such bad information - maybe it's coming from a
particular offline example. I'd have to say that the GObject/GLib/Gtk
API documentation doesn't make it clear that although type is a
numerical value it cannot be handled as a numerical value in a portable
manner.

In the cases that you have found, has the use of guint also been a
long-standing issue or are people putting this into new code?

I somehow doubt anyone developing gnucash has been developing on an
alpha.

--


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpTvWwoPz9pk.pgp
Description: PGP signature

Reply via email to