
Peter Dimov wrote:
Peter Dimov wrote:
Roland Schwarz:
Andrey Semashev wrote:
I also noticed lots of warnings "unused variable 'res'" and alikes while compiling my projects with GCC 4.2.1 on OpenSUSE. I already noticed this, and asked Peter Dimov to provide a BOOST_VERIFY macro to get rid of them.
I surely could do with a macro that is private to the thread library, but since I think the issue is a more general one, I'd prefer to wait until Peter supplies a global one. I'll add BOOST_VERIFY if Beman agrees that it should be supplied as part of 1.35. I missed the discussion of exactly what BOOST_VERIFY does, but since it's a new macro I assume it won't break any existing code. If that's correct, go ahead for 1.35.
--Beman
BOOST_VERIFY added to trunk. It's the same as BOOST_ASSERT, but always evaluates its argument. This helps to suppress warnings for unused variables and can also be used if the asserted expression has desirable side effects.
Nice! I suggest adding an additional sentence to the docs: "BOOST_VERIFY is useful for suppressing warnings about unused variables or when the asserted expression has desirable side effects." --Beman