[SERVER-1371] BSONObjBuilder does not handle uint64_t correctly (overloaded append() are ambiguous) Created: 07/Jul/10 Updated: 27/Sep/11 Resolved: 07/Jul/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Mark Sung | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu Lucid 64bit, GCC 4.3.4/4.4.3 |
||
| Backwards Compatibility: | Major Change |
| Operating System: | Linux |
| Participants: |
| Description |
|
The following code does not compile due to ambiguous BSONObjBuilder::append() overload code: gcc compile error messages: /usr/include/mongo/client/../db/jsobj.h:1924: error: call of overloaded 'append(const char*&, long unsigned int&)' is ambiguous Apparently the problem is that BSONObjBuilder::append() does not overload specifically for "unsigned long long" type so for uint64_t it's possible to match all types, leading to ambiguous overload. This bug is in all release, including the trunk version. |
| Comments |
| Comment by Liang Sun [ 27/Sep/11 ] |
|
I think you should have implemented a method with an unsigned 64 bit integer type, as what the long unsigned integer type is depends on the c++ compiler. |
| Comment by Eliot Horowitz (Inactive) [ 07/Jul/10 ] |
|
there isn't an unsigned 64 bit integer type, so this message is correct. |