[SERVER-11020] Consistently use NDEBUG across all TU's when building without debugging Created: 03/Oct/13  Updated: 18/Sep/15  Resolved: 27/Mar/15

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.1.1

Type: Task Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: build
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-16496 override Boost's assert handler Closed
Backwards Compatibility: Fully Compatible
Sprint: Platform 1 04/03/15
Participants:

 Description   

For historical reasons, we have not been defining NDEBUG globally in the server build. This resulted in at least one subtle misconfiguration (see SERVER-11010). We fixed SERVER-11010 by adding NDEBUG, but scoped only to the gperftools build, but this won't protect against other future third_party dependencies on NDEBUG.

We should, early in 2.7, promote NDEBUG to the top level build for non-debug builds.



 Comments   
Comment by Githook User [ 27/Mar/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-11020 Don't overload the meaning of _DEBUG, use our own debug macro
Branch: master
https://github.com/mongodb/mongo/commit/67cf6c0d51bf59a1933325c793b02c220283f331

Comment by Eric Milkie [ 26/Mar/15 ]

I'm leaning towards using something private to MongoDB, instead of using NDEBUG. After refreshing my memory with SERVER-16496, it seems like it would be helpful to avoid problems in the future if we do NOT use NDEBUG, in case a future third-party product makes use of it and changes behavior in a way we dislike.
It will mean that when importing new third-party code, we should remember to check if such code uses NDEBUG and what repercussions it has.

Generated at Thu Feb 08 03:24:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.