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 657444 - "enum foo { ... }"; not recognized
"enum foo { ... }"; not recognized
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.17
Other Linux
: Normal normal
: 1.21
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-26 13:59 UTC by Miloslav Trmac
Modified: 2014-04-22 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkdoc-scan.in: allow ordinary structs and enums to be documented (3.73 KB, patch)
2014-03-28 17:19 UTC, Thomas Wood
accepted-commit_now Details | Review
gtkdoc-scan.in: allow ordinary structs and enums to be documented (3.20 KB, patch)
2014-04-22 11:10 UTC, Thomas Wood
committed Details | Review
gtkdoc-scan.in: allow ordinary structs and enums to be documented (3.21 KB, patch)
2014-04-22 12:19 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Miloslav Trmac 2011-08-26 13:59:12 UTC
gtkdoc-scan doesn't recognize plain enums.  It recognizes only:
> enum _foo { ... };
(note the leading underscore) and
> typedef enum ... { ... } foo;
Comment 1 Miloslav Trmac 2011-08-26 15:18:51 UTC
... and the same for structs, apparently.
Comment 2 Yeti 2011-08-26 15:39:57 UTC
Well, the convention in GTK+/GNOME related software is to always typedef data types.  gtk-doc assumes this convention and IIRC if you do

enum _foo { ... };

you anyway get documentation for

typedef enum { ... } foo;

because that's the convention.
Comment 3 Miloslav Trmac 2011-08-26 16:11:06 UTC
Fair enough, my use is not exactly GNOME-related, so I'll have to somehow deal with it.
Comment 4 Thomas Wood 2014-03-28 17:19:15 UTC
Created attachment 273188 [details] [review]
gtkdoc-scan.in: allow ordinary structs and enums to be documented

Currently, structs will only be documented if they have a type definition, a
forward declaration, or the struct name starts with an underscore. Enums are
documented if the enum name starts with an underscore or it has a type
definition. In both cases, if the enum or struct name begins with an
underscore, it is assumed to be the declaration of the struct or enum without
the underscore.

This patch allows ordinary structs and enums to be documented, without the need
for type definitions or forward declarations.
Comment 5 Thomas Wood 2014-03-28 17:37:50 UTC
I have tested the patch against gtk+ and glib and it doesn't appear to make any difference to the documentation, with the exception of adding one symbol (a documented struct) to the gio documentation.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2014-03-28 19:58:46 UTC
Thanks for the patch, out of curiosity, which symbol in gio did you saw.
Comment 7 Thomas Wood 2014-03-31 10:51:35 UTC
The symbol is kqueue_notification, which appears in gio/kqueue/kqueue-thread.h. However, the headers in the kqueue directory are not installed and many of the symbols in them already appear in gio-unused.txt. The kqueue directory should probably be added to IGNORE_HFILES in docs/reference/gio/Makefile.am.
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2014-04-14 18:52:55 UTC
Review of attachment 273188 [details] [review]:

Looks good. Just a small nit.

::: tests/bugs/src/tester.h
@@ +88,3 @@
+ * http://bugzilla.gnome.org/show_bug.cgi?id=411739
+ */
+struct bug411739 {

can please just add another struct and make this bug657444, so that the context is correct.
Comment 9 Thomas Wood 2014-04-16 16:30:00 UTC
(In reply to comment #8)
> Review of attachment 273188 [details] [review]:
> 
> Looks good. Just a small nit.
> 
> ::: tests/bugs/src/tester.h
> @@ +88,3 @@
> + * http://bugzilla.gnome.org/show_bug.cgi?id=411739
> + */
> +struct bug411739 {
> 
> can please just add another struct and make this bug657444, so that the context
> is correct.

This struct was added for testing bug 411739 and since it now needs to be documented, I renamed it to explicitly reference that bug. Would you prefer it to remain named as it was?
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2014-04-16 19:11:40 UTC
Right, that makes sense. Thanks for clarifying. I'll push this soon.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2014-04-22 10:09:06 UTC
Hi, can you please re-upload a rebased patch?
Comment 12 Thomas Wood 2014-04-22 11:10:02 UTC
Created attachment 274878 [details] [review]
gtkdoc-scan.in: allow ordinary structs and enums to be documented
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2014-04-22 12:19:01 UTC
The following fix has been pushed:
598f6d7 gtkdoc-scan.in: allow ordinary structs and enums to be documented
Comment 14 Stefan Sauer (gstreamer, gtkdoc dev) 2014-04-22 12:19:11 UTC
Created attachment 274883 [details] [review]
gtkdoc-scan.in: allow ordinary structs and enums to be documented