[CDRIVER-757] Unsigned comparison in _mongoc_matcher_op_compare_new() is always true Created: 21/Jul/15 Updated: 12/Aug/15 Resolved: 07/Aug/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.1.9 |
| Fix Version/s: | 1.2-beta0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Jeremy Mikola | Assignee: | Jeremy Mikola |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The following error recently popped up in the PHPC builds after bjori added -Werror to our build flags (here):
I traced this back to this commit. While we could suppress this error with [-Wno-type-limits], that might hide other errors, too. Some ideas tossed around in this thread include adding an unused negative value to the enum to force a signed type to be used (which seems noisy) or to for a signed cast before the comparison. Alternatively, we can just do without the >= MONGOC_MATCHER_OPCODE_EQ part of the assertion if we want to rely on the enum being unsigned and MONGOC_MATCHER_OPCODE_EQ being zero. |
| Comments |
| Comment by Githook User [ 07/Aug/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}Message: Merge pull request #256 from jmikola/cdriver-757
|
| Comment by Githook User [ 07/Aug/15 ] |
|
Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}Message: If the enum is compiled as an unsigned integer, this could trigger a type-limits warning (which might disrupt a -Werror build). |
| Comment by Jeremy Mikola [ 30/Jul/15 ] |
| Comment by Githook User [ 21/Jul/15 ] |
|
Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}Message: Don't build with -Werror until Reverts 8087ab6d97970e1e9162ce6798e244127dc12bbf temporarily |