Modify

Opened 5 years ago

Last modified 5 years ago

#8278 reopened Bugs

BOOST_ASSERT_MSG prerocessed out if NDEBUG is defined regardless of BOOST_ENABLE_ASSERT_HANDLER

Reported by: Eric Niebler Owned by: Beman Dawes
Milestone: To Be Determined Component: utility
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

There is an inconsistency in boost/assert.hpp. The macros BOOST_ASSERT and BOOST_VERIFY are *not* preprocessed out when BOOST_ENABLE_ASSERT_HANDLER is defined, but BOOST_ASSERT_MSG is. The inconsistency should be resolved one way or the other, and I think making BOOST_ASSERT_MSG behave like the other two makes the most sense.

Assigning to you, Peter, since you created this file. Please reassign as appropriate.

Attachments (1)

assert.patch (605 bytes) - added by Eric Niebler 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by Peter Dimov

Owner: changed from Peter Dimov to Beman Dawes

I think that Beman added the _MSG variants. I agree that ASSERT_MSG should follow ASSERT.

comment:2 Changed 5 years ago by viboes

Resolution: duplicate
Status: newclosed

duplicated of #7028

comment:3 Changed 5 years ago by Eric Niebler

Resolution: duplicate
Status: closedreopened

I don't believe this issue is a dupe of #7028. That issue (which I disagree with) suggests that all the assert macros be processed out when NDEBUG is defined, even when BOOST_ENABLE_ASSERT_HANDLER is defined. This issue is specifically about making BOOST_ASSERT_MSG consistent with the other macros, which are currently left in always when BOOST_ENABLE_ASSERT_HANDLER is defined.

comment:4 Changed 5 years ago by viboes

#7028 patch makes the 3 macros uniform. Could you provide a patch that clarifies what do you expect?

comment:5 in reply to:  4 Changed 5 years ago by viboes

Replying to viboes:

#7028 patch makes the 3 macros uniform. Could you provide a patch that clarifies what do you expect?

Oh, I think I understand the issue now. See #7028.

Changed 5 years ago by Eric Niebler

Attachment: assert.patch added

comment:6 Changed 5 years ago by Eric Niebler

I've attached a patch that addressed the problem the way I think it should be addressed, and the way that is least surprising for existing users of BOOST_ASSERT. It should be applied to trunk as it is as of [83430].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain Beman Dawes.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.