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 667938 - wrong gtypes generated for empty flags enums
wrong gtypes generated for empty flags enums
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-01-14 23:34 UTC by Christian Persch
Modified: 2012-01-25 02:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ensure to generate a flags GType for empty Flags enums (1.53 KB, patch)
2012-01-14 23:36 UTC, Christian Persch
accepted-commit_now Details | Review

Description Christian Persch 2012-01-14 23:34:50 UTC
When there's only one defined value of a Flags enum (usually a NONE = 0 entry), the generated gioenumtypes.c file creates the gtype as an enum type instead of as a flags type.
Comment 1 Christian Persch 2012-01-14 23:36:55 UTC
Created attachment 205281 [details] [review]
Ensure to generate a flags GType for empty Flags enums

When the flags enum only has the default NONE = 0 entry, glib-mkenums
creates an enum type for it, not a flags type. Add an annotation to the
enum to ensure the correct GType is created.

Bug #667938.
Comment 2 Emmanuele Bassi (:ebassi) 2012-01-15 10:31:44 UTC
Review of attachment 205281 [details] [review]:

looks good to me.
Comment 3 Christian Persch 2012-01-15 12:04:17 UTC
Pushed to master.
Comment 4 Matthias Clasen 2012-01-25 02:24:35 UTC
*** Bug 668522 has been marked as a duplicate of this bug. ***