[SERVER-1313] don't use assert, but verify Created: 18/Jun/10  Updated: 29/May/12  Resolved: 03/May/11

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jesper Hansen Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux


Participants:

 Description   

In the current master version, this wont compile:

#include <assert.h>
#include "mongo/client/dbclient.h"
int main()
{
assert(0);
return 0;
}

I just get the following error:

test.cpp: In function 'int main()':
test.cpp:5: error: 'assert' was not declared in this scope

I looks like mongo redefines the assert macro, this is an unexpected, and undesired side effect.



 Comments   
Comment by Pedro Larroy [ 21/Mar/12 ]

Also malloc is redefined, this is horrible.

Comment by Eliot Horowitz (Inactive) [ 03/May/11 ]

See SERVER-1259

Comment by Mathias Stearn [ 28/Jun/10 ]

We're planning some changes to the packaging process for the C++ driver in 1.7. Until then, you can just include cassert.h after all mongo headers.

Comment by Mathias Stearn [ 28/Jun/10 ]

C++ driver issues belong in the Core Server project, not the C Driver Project

Generated at Thu Feb 08 02:56:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.