GNOME Bugzilla – Bug 721481
scanner: Re-evaluate the usage of disguised
Last modified: 2018-02-08 12:26:04 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.
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;
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Is this still relevant, or something we want?
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.
-- 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.