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 721481 - scanner: Re-evaluate the usage of disguised
scanner: Re-evaluate the usage of disguised
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-01-04 21:58 UTC by Simon Feltman
Modified: 2018-02-08 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scanner: Cleanup misuse of disguised attribute to mean private (15.29 KB, patch)
2014-01-04 22:26 UTC, Simon Feltman
none Details | Review

Description Simon Feltman 2014-01-04 21:58:45 UTC
When working on bug 581525, there was some question as to whether the usage of the "disguised" attribute on structs is correct. Colin mentioned it might be intended only for typedef struct pointers as in:

typedef struct _Foo* FooPtr;

However, it seems to have taken on the meaning of "private" and is set when any typedef struct is parsed which doesn't also include a full struct with fields:

typedef struct _Foo Foo;

(with no regular struct _Foo defined later)

Changing this now will generate extra mallard pages and also the attribute will be removed from a lot of structs in various GIRs. So a deeper evaluation is needed.
Comment 1 Simon Feltman 2014-01-04 22:26:06 UTC
Created attachment 265347 [details] [review]
scanner: Cleanup misuse of disguised attribute to mean private

Remove logic dealing with a misuse of the disguised Node attribute to mean
private in various struct creation functions. Only apply the disguised
attribute directly when parsing a typedef in the form of:
typedef struct _Foo* Foo;
Comment 2 André Klapper 2015-02-07 17:10:52 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 3 Emmanuele Bassi (:ebassi) 2018-01-24 18:21:07 UTC
Is this still relevant, or something we want?
Comment 4 Tomasz Miąsko 2018-01-29 07:38:34 UTC
Currently gir still contains records that are incorrectly marked as disguised.
The original commit that introduced disguised attribute described it as follows:

  Certain types like GIConv and GdkAtom are pointers internally but don't
  look like pointers when referenced. They have the form.

   typedef struct _X *X;

  Parse these as structures/records but mark them in the gir with a 'disguised'
  attribute so that we know that they need special handling.

It was used then, and still is used now, to determine that some records are
actually a pointers. Without it you couldn't for example determine the size of
GdkAtom, and call any functions that pass it by value.

It also means that until this bug is fixed, some records are incorrectly
treated as pointers (especially concluded to be pointer sized). This is
potentially somewhat harmless, because in all of those incorrect cases
records probably won't be passed by value through public API anyway.
Comment 5 GNOME Infrastructure Team 2018-02-08 12:26:04 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/101.