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 671322 - scanner should warn about enum values with numeric names
scanner should warn about enum values with numeric names
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-03-04 20:39 UTC by Dan Winship
Modified: 2018-02-08 12:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Emit a warning for enum values starting with a number (1.43 KB, patch)
2018-01-24 17:25 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Dan Winship 2012-03-04 20:39:46 UTC
spinoff from bug 671025

When the scanner outputs something like

      <member name="2button_press"
              value="5"
              c:identifier="GDK_2BUTTON_PRESS"
              glib:nick="2button-press"/>

it should print a warning, unless the enum also has another member with the same value and a usable name.
Comment 1 André Klapper 2015-02-07 17:10:41 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 2 Emmanuele Bassi (:ebassi) 2018-01-24 17:25:42 UTC
Created attachment 367392 [details] [review]
Emit a warning for enum values starting with a number

Not all languages allow identifiers to start with a number, so we should
emit a warning, to catch cases like:

  GDK_2BUTTON_PRESS

mapping to:

  Gdk.EventType.2BUTTON_PRESS
Comment 3 Emmanuele Bassi (:ebassi) 2018-01-24 17:28:37 UTC
Detecting replacements is kind of hard to achieve; some enumerations may add identical values, but others may deprecate the symbol entirely and replace it.

I'd stick to warning, even if it introduces spurious messages for older libraries that decide to keep unusable values around. It's not like those libraries have no warnings to begin with.
Comment 4 GNOME Infrastructure Team 2018-02-08 12:14:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/65.