Opened 11 years ago
Closed 10 years ago
#6609 closed Patches (duplicate)
Inconsistent BOOST_ASSERT and BOOST_ASSERT_MSG behavior
Reported by: | Owned by: | No-Maintainer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | utility |
Version: | Boost 1.48.0 | Severity: | Cosmetic |
Keywords: | BOOST_ASSERT | Cc: | k_satoda@… |
Description
BOOST_ASSERT and BOOST_VERIFY respect BOOST_DISABLE_ASSERTS and ignore NDEBUG when BOOST_ENABLE_ASSERT_HANDLER is defined. BOOST_ASSERT_MSG, however, always respects NDEBUG.
Bug fix attached.
Attachments (1)
Change History (6)
by , 11 years ago
Attachment: | patchfile.patch added |
---|
comment:1 by , 10 years ago
Component: | None → utility |
---|---|
Owner: | set to |
comment:2 by , 10 years ago
Type: | Bugs → Patches |
---|
comment:3 by , 10 years ago
Cc: | added |
---|
-1 for the patch. The opposite seems more practical for me. Please see #7028.
The patch also looks incomplete. The related documentation should be updated, too.
comment:4 by , 10 years ago
The fact is that the current behavior (i.e. BOOST_ASSERT ignoring NDEBUG when BOOST_ENABLE_ASSERT_HANDLER is set) is something that has been existing since the introduction of boost/assert.hpp in boost 1.27.
BOOST_ASSERT_MSG is a new extension added in boost 1.46 and it does not to behave like BOOST_ASSERT. Nothing in the documentation on BOOST_ASSERT_MSG says it is by desing, so it is a bug.
Ticket #7028 (whenever the current BOOST_ASSERT behavior is practical) is not a bug, but a question open for debate.
For the current version of boots this bugfix is appropriate and should be applied. The documented behavior as well as the behavior of the long existed BOOST_ASSERT is not to be changed, so I see no need update the documentation.
Anyway, my bug report is 10 months old, several boost releases got out since then, still with the bug, and nobody seems to care. So I guess it is Ok to close this ticket and do something once the decision on #7028 is made.
Please set the component in the future if you want it to be analyzed.