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 751798 - Wrong enum type used in some test-cases
Wrong enum type used in some test-cases
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gregex
2.44.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-07-01 18:47 UTC by Daniel Macks
Modified: 2015-07-13 19:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix enum type (2.25 KB, patch)
2015-07-01 18:53 UTC, Daniel Macks
committed Details | Review

Description Daniel Macks 2015-07-01 18:47:44 UTC
glib-244.1 on OS X 10.8 (xcode-5.1) gives 10 warnings in glib/tests/regex.c starting with:

  CC       regex.o
regex.c:2317:22: warning: implicit conversion from enumeration type 'GRegexCompileFlags' to different enumeration type 'GRegexMatchFlags' [-Wenum-conversion]
  TEST_MATCH("a", 0, G_REGEX_ANCHORED, "a", -1, 0, 0, TRUE);
  ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
regex.c:215:22: note: expanded from macro 'TEST_MATCH'
  data->match_opts = _match_opts;                                       \
                     ^
and the same for each of the successive 9 lines in that source. The the second parameter of TEST_MATCH, _compile_opts, is fed to a TestMatchData.compile_opts (type GRegexCompileFlags), whereas the third parameter, _match_opts, is fed to TestMatchData.match_opts (type GRegexMatchFlags). In these 10 tests, G_REGEX_ANCHORED, a GRegexCompileFlags, is in the match_opts position. Instead, should be using G_REGEX_MATCH_ANCHORED. Both are numerically equal, so the test works regardless.
Comment 1 Daniel Macks 2015-07-01 18:53:28 UTC
Created attachment 306558 [details] [review]
Fix enum type
Comment 2 Christian Persch 2015-07-03 18:00:41 UTC
Comment on attachment 306558 [details] [review]
Fix enum type

Looks fine.
Comment 3 Daniel Macks 2015-07-13 17:50:48 UTC
I don't have commit bit...could someone please push?
Comment 4 Emmanuele Bassi (:ebassi) 2015-07-13 19:11:14 UTC
Attachment 306558 [details] pushed to master.