According to Joaquin Cuenca Abela <[EMAIL PROTECTED]>:
> in ie_exp.cpp, line 62, we have:
> 
>       UT_ASSERT(m_sniffers.addItem (s, &ndx) == UT_OK);
> 
> but if we define NDEBUG, UT_ASSERT will expand to nothing, thus in
> production conditions it will be equivalent to:
> 
>  ;
> 
> when I think that it should be equivalent to:
> 
>  m_sniffers.addItem (s, &ndx);
> 
> Am I missing something?
> 

UT_ASSERT is #defined as assert in non debug (NDEBUG).
assert is defined as is:
# define assert(expr)           ((void) 0)

So expr is discarded at compile time.

The bottom line: the above code is wrong and should be fixed by
moving the function call outside UT_ASSERT.


Hub

Reply via email to