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 744061 - Skip standard g_iface, parent_instance and parent_class struct members
Skip standard g_iface, parent_instance and parent_class struct members
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.25
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-05 17:27 UTC by Xavier Claessens
Modified: 2015-09-22 14:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ignore standard struct members (833 bytes, patch)
2015-02-05 17:28 UTC, Xavier Claessens
reviewed Details | Review
Ignore standard struct members (2.66 KB, patch)
2015-02-06 16:38 UTC, Xavier Claessens
committed Details | Review
Ignore standard struct members (2.68 KB, patch)
2015-09-22 14:41 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Xavier Claessens 2015-02-05 17:27:55 UTC
It's boring to document them, better just ignore from gtk-doc. Suggested by desrt in bug #740814 comment #43.
Comment 1 Xavier Claessens 2015-02-05 17:28:40 UTC
Created attachment 296215 [details] [review]
Ignore standard struct members
Comment 2 Xavier Claessens 2015-02-05 19:49:55 UTC
Code pushed as wip/xclaesse/fixes-for-glib
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2015-02-05 21:51:53 UTC
Review of attachment 296215 [details] [review]:

+1 for the idea, but won't this cause warnings for existing docs about unused documentation?

::: gtkdoc-common.pl.in
@@ +122,3 @@
 
+    # Remove g_iface, parent_instance and parent_class if they are first member
+    $declaration =~ s/(\{)\s*(\w)+\s+(g_iface|parent_instance|parent_class)\s*;/$1/g;

please also add 'parent' - I see that a lot in code. Would be good to also mention these naming requirements in the docs.
Comment 4 Xavier Claessens 2015-02-05 23:18:33 UTC
It does warn for unused symbol indeed, had to remove them in glib. Is there a way to skip them from unused as well?

I was a bit scared that "parent" is too common.

Where can this convention be documented?
Comment 5 Allison Karlitskaya (desrt) 2015-02-06 11:03:13 UTC
I like this as well, and I particularly like that it hints people into using the stetic names for these fields.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-02-06 15:21:38 UTC
I think the gobject docs should document the conventions. For gtk-doc help/manual/C/index.docbook is the documentation - search for "Struct comment block". We probably want to mention the special case for object, class and iface explicitly.

The *_unused.txt is produced in gtkdoc-mkdb:OutputUnusedSymbols().
Comment 7 Xavier Claessens 2015-02-06 16:38:21 UTC
Created attachment 296298 [details] [review]
Ignore standard struct members
Comment 8 Xavier Claessens 2015-02-06 16:42:02 UTC
Great, with this patch, g_iface/parent_instance/parent_class are silently ignored. And it's even documented trick now, even if I'm pretty sure nobody on earth will ever read that doc :p
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2015-02-06 17:27:12 UTC
Some people read the doc :) I wonder if you can run some find/grep magic do check for popular names here. I'll do that for gstreamer and se if I can also come up with a sed that drops the now not need doc-lines.

Maybe we can add a TRACE line when dropping not needed docs, then one can build the docs with gtk-doc tracing enabled and grep the items that can be removed.
Comment 10 Xavier Claessens 2015-02-06 18:30:25 UTC
I did that on glib:

for f in `git ls-files`; do sed -i '/ \* @g_iface/d' $f; done

But didn't submit the resulting patch, because it's armless to keep them.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2015-09-22 14:41:34 UTC
The following fix has been pushed:
1a24170 Ignore standard struct members
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2015-09-22 14:41:43 UTC
Created attachment 311875 [details] [review]
Ignore standard struct members