[SERVER-1273] Can't include bson/bson.h and client/connpool.h in same file due to msgasserted conflict Created: 21/Jun/10 Updated: 12/Jul/16 Resolved: 20/Dec/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Eric Milkie |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
All |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
Given the current git head, the following file will not compile: #include <cmath> It fails as follows: In file included from /afs/acr/users/acm/mongo.temp.install/include/mongo/client/../util/../util/../db/../util/optime.h:20, |
| Comments |
| Comment by Eric Milkie [ 12/Jan/12 ] |
|
Hi Michael, |
| Comment by Michael Wieher [ 12/Jan/12 ] |
|
The github link shows changes that are not reflected on the driver download. Notably, the msgasserted function does not exist, that is, the updates to uasserted are on the package downloaded via http://www.mongodb.org/pages/viewpage.action?pageId=21269361 #C++ language center however, the changes to msgasserted were not pushed to the package linked on the website, and I believe a function which relied/relies upon the current (ambiguous) msgasserted signature needs to be re-worked once the change is actually pushed. |
| Comment by Eric Milkie [ 20/Dec/11 ] |
|
Fixed headers will be in the next release! |
| Comment by auto [ 20/Dec/11 ] |
|
Author: {u'login': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}Message: Both header files define certain assert functions inline. If you are using the C++ driver, |
| Comment by Andrew Morrow (Inactive) [ 23/Feb/11 ] |
|
I believe you, but it sort of misses the point. Client facing include files should never have this sort of order dependency. Every header in the set of client facing headers should be
Basically, the first three criteria can be validated by the following tests:
The mongo C++ driver headers currently don't pass these sorts of tests. |
| Comment by Scott Hernandez (Inactive) [ 20/Feb/11 ] |
|
You can work around this issue by including more stuff via db/jsobj.h, instead of just bson.h. |
| Comment by Andrew Morrow (Inactive) [ 08/Feb/11 ] |
|
Recently, this has become an issue for me as well, using mongo 1.6.3 |
| Comment by Lance Diduck [ 02/Sep/10 ] |
|
It did break things for me |
| Comment by Andrew Morrow (Inactive) [ 29/Jul/10 ] |
|
This issue isn't personally blocking anything for me, since I don't happen to have a need to include both of these files in the same translation unit right now. However, it is almost certainly going to break things for some user of the C++ driver. I'd looked at fixing this myself but the assertion macros are somewhat subtle and I don't want to break anything. It feels like a refactoring best left to the experts. But I'd still hope to see this fixed in 1.5 if possible. FWIW, the error message has changed somewhat: #include <mongo/bson/bson.h> gets you: In file included from /home/acm/tmp/mongo-tmp-install/include/mongo/client/../util/../util/../db/../util/optime.h:20, |