GNOME Bugzilla – Bug 794506
glib-mkenums: Enters infinite loop if using typedef enum SomeIdentifier { }
Last modified: 2018-03-21 15:20:17 UTC
As the summary states, if I use typedef enum _SomeEnumIdentifier { ENUM_VALUE } SomeEnumIdentifier; to define one of my enums, glib-mkenums goes into an infinite loop, because it is unable to match typedef enum _SomeEnumIdentifier . There's really two issues here 1) glib-mkenums should error out when it detects the purported syntax error 2) The above is valid syntax, and glib-mkenums should handle it.
Created attachment 369884 [details] [review] glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error
Created attachment 369885 [details] [review] glib-mkenums: Don't go into an infinite loop trying to match {
Review of attachment 369884 [details] [review]: I wish we had a test suite for glib-mkenums; this would be a perfect test case to add to it (thanks for the detailed description). Unless you particularly want to write one, this patch shouldn’t block on it though.
Review of attachment 369885 [details] [review]: ++
Pushed to master. I’ll backport to glib-2-56 too. Attachment 369884 [details] pushed as 7027a12 - glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error Attachment 369885 [details] pushed as 5e02a9f - glib-mkenums: Don't go into an infinite loop trying to match {
Backported to glib-2-56: 3c5e8a65f (HEAD -> glib-2-56, origin/glib-2-56) glib-mkenums: Don't go into an infinite loop trying to find a matching { 145e45f55 glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error