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 706404 - Minor bug in gtkdoc-mkdb
Minor bug in gtkdoc-mkdb
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.20
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-20 14:32 UTC by Damon Chaplin
Modified: 2014-02-08 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Damon Chaplin 2013-08-20 14:32:15 UTC
I think I just spotted a minor bug in gtkdoc-mkdb.

It needs brackets around the return expression or it doesn't seem to evaluate
the "$root ne 'GEnum' and $root ne 'GFlags'" bit.


diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index eb11093..91de12d 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -5305,7 +5305,7 @@ sub CheckIsObject {
     my $root = $ObjectRoots{$name};
     # Let GBoxed pass as an object here to get -struct appended to the id
     # and prevent conflicts with sections.
-    return defined($root) and $root ne 'GEnum' and $root ne 'GFlags';
+    return (defined($root) and $root ne 'GEnum' and $root ne 'GFlags');
 }
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2013-08-21 18:04:43 UTC
> perl -e "print 'yes' if defined(\$root) and \$root ne 'GEnum';"
> perl -e "\$root='abc'; print 'yes' if defined(\$root) and \$root ne 'GEnum';"
yes
> perl -e "\$root='GEnum'; print 'yes' if defined(\$root) and \$root ne 'GEnum';"

How did you notice? or what is not working?
Comment 2 Damon Chaplin 2013-08-21 20:28:24 UTC
I was getting lots of duplicate IDs for enums and flags in GooCanvas.
(These are just wrappers for cairo types so I've had to hack them a bit
to get them working and documented OK. So ignore my particular case!)

It turned out that CheckIsObject was returning TRUE for enums and flags when
it should be returning FALSE.

"return" has higher precedence than "and" (which has a very low precedence) so you need the brackets.


That ID stuff in gtk-doc has got a bit over-complicated so I don't know if this will break something else.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-08 18:37:42 UTC
commit 6a64e762db543e8a04138dcbb37de4817db95e0a
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Sat Feb 8 19:33:22 2014 +0100

    mkdb: fix CheckIsObject return value
    
    It needs brackets around the return expression or it doesn't seem to evaluate
    the "$root ne 'GEnum' and $root ne 'GFlags'" bit.
    Spotted by Damon Chaplin
    
    Fixes #706404