well spotted. we've had assert on for so long i've forgotten all about 
that.

i would like the option of making moses go extra fast by turning off 
assert, so have moved function calls with side effects out of asserts.

On 12/08/2010 09:54, Barry Haddow wrote:
>> On 11/08/2010 02:44, Yonee Yang wrote:
>>> hi:
>>> 1.
>>> 96th line in "PhraseDictionary.cpp "
>>>
>>> assert(pdm->Load(m_input
>>> , m_output
>>> , m_filePath
>>> , m_weight
>>> , m_tableLimit
>>> , staticData.GetAllLM()
>>> , staticData.GetWeightWordPenalty()));
>>> return pdm;
>>>
>>> if define NDEBUG these codes can't be reached, is a bug?
> Hi
>
> Yonee's correct, an assert() should never have side-effects because if you
> define NDEBUG, then all the assert()s get no-opped. However we never build
> moses with NDEBUG, so it's not a big issue.
>
> regards
> Barry
>
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to