Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-07-06 06:44:41


On Thu, 6 Jul 2006 13:29:58 +0300, "Peter Dimov" <pdimov_at_[hidden]>
wrote:

>Gennaro Prota wrote:
>
>> #define BOOST_ASSERT(expr) \
>> ( \
>> (void)sizeof boost::detail::assert_ \
>> ::valid_assert_expression(expr) \
>> , assert(expr) \
>> ) /**/

Sorry, I thought you had read my earlier post about this. I found some
invocations of BOOST_ASSERT which don't use an expression with int
type. When BOOST_ASSERT falls back to the standard assert macro it may
work or not, depending on what the underlying C library does. See the
last part of this message:

 <http://lists.boost.org/Archives/boost/2006/06/106721.php>

Frequently the C library adds a 0 != in front of (expr), uses a ?:
operator, or ||, so that everything works as expected (and, in fact,
C99 extends the specification to allow any scalar expression --as
that's easy to deal with for the library). But that's not guaranteed.

--
[ Gennaro Prota, C++ developer for hire ]
[    resume:  available on request      ]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk