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 674119 - glib-mkenum does not understand named enums
glib-mkenum does not understand named enums
Status: RESOLVED DUPLICATE of bug 669595
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-04-14 22:54 UTC by Behdad Esfahbod
Modified: 2017-10-24 12:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2012-04-14 22:54:20 UTC
glib-mkenums looks for typedef enums with this regex:

    if (m@^\s*typedef\s+enum\s*
           ({)?\s*
           (?:/\*<
             (([^*]|\*(?!/))*)
            >\s*\*/)?
           \s*({)?
         @x) {


So, for example the following wouldn't work:

typedef enum _my_enum {
  ...
} my_enum;

I like to add the name to the enum because gdb understands that better.
Comment 1 Jorge Villaseñor 2013-01-17 23:00:47 UTC
I can confirm this bug. It do breaks the compilation for Pidgin's Gobjectification branch.
I do have glib 2.34.3 in an Archlinux system.

I also have a preliminar patch which can fix it (I don't know perl but it looks like working in my quick test).

I paste the patch here because I have the code in a VM and it is a mess to get stuff out from there.

--- glib-mkenums.orig   2013-01-17 16:55:55.644141112 -0600
+++ glib-mkenums        2013-01-17 16:56:49.854144216 -0600
@@ -293,7 +293,7 @@ while (<>) {
        # ignore forward declarations
        next if /^\s*typedef\s+enum.*;/;
 
-       if (m@^\s*typedef\s+enum\s*
+       if (m@^\s*typedef\s+enum\s*\w*\s*
                ({)?\s*
                (?:/\*<
                (([^*]|\*(?!/))*)
Comment 2 Philip Withnall 2017-10-24 12:18:44 UTC
Fixed as bug #669595.

*** This bug has been marked as a duplicate of bug 669595 ***