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 687615 - PARAM_READWRITE has wrong value in GObject-2.0.gir
PARAM_READWRITE has wrong value in GObject-2.0.gir
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
2.35.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 727370
 
 
Reported: 2012-11-05 06:49 UTC by Martin Pitt
Modified: 2018-02-08 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (4.29 KB, patch)
2014-03-31 02:31 UTC, Philip Chimento
none Details | Review

Description Martin Pitt 2012-11-05 06:49:54 UTC
glib defines this as

  #define G_PARAM_READWRITE       (G_PARAM_READABLE | G_PARAM_WRITABLE)

in gobject/gparam.h, but this comes out wrong in the .gir:

    <constant name="PARAM_READWRITE" value="0" c:type="G_PARAM_READWRITE">
      <type name="gint" c:type="gint"/>
    </constant>

This should have a value of "3".
Comment 1 Martin Pitt 2012-11-05 06:52:56 UTC
Same problem with

    <constant name="PARAM_STATIC_STRINGS"
              value="0"
              c:type="G_PARAM_STATIC_STRINGS">

which is defined as

  #define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)

and thus should be 224.
Comment 2 Philip Chimento 2014-03-31 02:31:32 UTC
Created attachment 273311 [details] [review]
Test case
Comment 3 Philip Chimento 2014-03-31 02:32:12 UTC
I ran into this as well and took a look at what GI does. You'll notice that G_PARAM_MASK, for example, does have the right value. What happens is that GI only picks up the value of the #define if it is a literal.

One way around this is to compute the value if it can be done using already-introspected values from the symbol table. I'm not sure if this is actually possible.

Another way (the 'head-in-the-sand' way) would be to change the definitions of G_PARAM_READWRITE and G_PARAM_STATIC_STRINGS to be integer literals.

I attached a test case for this bug above.
Comment 4 Philip Chimento 2014-03-31 02:42:00 UTC
See also https://bugzilla.gnome.org/show_bug.cgi?id=726037 which would fix the symptom but not the cause.
Comment 5 André Klapper 2015-02-07 17:21:39 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 6 GNOME Infrastructure Team 2018-02-08 12:19:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/75.