GNOME Bugzilla – Bug 751798
Wrong enum type used in some test-cases
Last modified: 2015-07-13 19:11:21 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.
Created attachment 306558 [details] [review] Fix enum type
Comment on attachment 306558 [details] [review] Fix enum type Looks fine.
I don't have commit bit...could someone please push?
Attachment 306558 [details] pushed to master.