Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-03-23 07:47:48


Peter Dimov wrote:

> Vladimir Prus wrote:
>> Peter Dimov wrote:
>>
>>> If the problem you are trying to fix is that assert() does not give
>>> enough information about the bug - and I haven't seen this
>>> particular problem reported as a defect
>>
>> I interpreted Kevin's post this way -- Boost.Tread fails and does not
>> produce any useful diagnostic.
>
> The proper way to fix that is to make Boost.Threads not fail, right?
> That's what invariant/"assertion" asserts are for - to catch bugs. They
> aren't an error reporting mechanism.

They are not. Specifically, "assert" is not a error reporting mechanism. But
still it prints the file name and line number, which helps to debug the
bugs that assert catches.

>>> - the proper way to fix it is to define an
>>> user-overrideable callback.
>>
>> I think you're overgeneralising. If assert prints an error message and
>> exits, then what's the problem with printing one extra diagnostic
>> message before assert?
>
> None (if you are sure that this is what assert does, of course - this is
> platform specific), except that the asserts should not fire. So spending
> time and effort to make something happen when the asserts fire is not
> productive.

I disagree. Here, two people report that they got assertion failures. Good,
but we have no idea why. If there were additional diagnostic, we'd knew the
exact system error which was reported.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net