After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317679 - GRelation field type not documented
GRelation field type not documented
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
2.6.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-01 11:35 UTC by Behdad Esfahbod
Modified: 2011-02-18 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2005-10-01 11:35:27 UTC
The docs for GRelation never specify what the type of data items inserted into
the relation are.  This is rather important, since g_relation_insert is a
varargs function, so for example inserting doubles produces buggy code but does
not trigger any compiler warnings of any sort.

The docs for g_relation_insert say:

... : 	the fields of the record to add. This must match the number of fields in
the GRelation. 


that should become:

... :   the fields of the record to add. This must match the number of fields in
the GRelation, and be of type gpointer or gconstpointer. 


or something along these lines...
Comment 1 Matthias Clasen 2005-10-02 03:40:25 UTC
Careful, if we document GRelation too well, someone might start using it...
Comment 2 Behdad Esfahbod 2005-10-02 23:20:53 UTC
:).  I was thinking about extending it to support more than two fields the other
day.  I wish there were more levels of deprecatedness.  There's no way for one
to know GMemChunks are bad through reading docs.  They still say "Memory chunks
provide an efficient way to allocate equal-sized pieces of memory"...  If
GRelation is an old mistake and doesn't belong to GLib if it was designed today,
then I like to see it in the docs.

One more thing I would like to see in the docs is time-order of the
implementations, plus some informal measure of heaviness.  For example, it's not
totally obvious for a new user that g_list_append is not O(1).  Of course if you
wait and think about you, you definitely find out GList is not keeping track of
the tail, but that's more a design/implementation issue.  Most people think of
doubly-linked lists as O(1)-append.
Comment 3 Owen Taylor 2005-10-03 00:12:09 UTC
I don't think there is anything *wrong* with GRelation (as far as we know),
the mistake in adding it was mostly that it hasn't proved useful to many
people (any people?).
Comment 4 Matthias Clasen 2005-10-27 02:43:48 UTC
Behdad, feel free to polish the GRelation docs if you want. 
Comment 5 Behdad Esfahbod 2006-01-31 23:23:09 UTC
2006-01-31  Behdad Esfahbod  <behdad@gnome.org>

        * docs/reference/glib/tmpl/relations.sgml (g_relation_insert): Specify
        the type of varargs arguments. (bug #317679)