|
Boost : |
Subject: Re: [boost] suggestion on assertion macros
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2010-03-16 15:25:44
Emil Dotchevski wrote:
> On Tue, Mar 16, 2010 at 10:47 AM, DE <satan66613_at_[hidden]> wrote:
>> on 16.03.2010 at 10:25
>> Emil Dotchevski wrote :
>>> I think that the solution is to disable such warnings in release
>>> builds. They serve no purpose other than to tell you that assert did
>>> what it was supposed to do in release.
>>
>>> MSVC has a similar warning, the one that says "removed unreachable
>>> code" which tells you that the optimizer deadstripped code that could
>>> not be executed anyway. How would you deal with that warning, add
>>> casts until the optimizer is sufficiently confused? :)
>>
>> one smart man (whom i have reasons to trust) said once that code must
>> compile with no warnings at the highest warning level
>> i think this is especially true about code that you give away (libs,
>> etc.)
>
> If we assume that the purpose of a warning message is to help writing
> "good" code, then we must agree that warnings that leads to "bad" code
> should be disabled. Otherwise, "fixing" warnings becomes a fetish.
I remember we've been discussing this topic a while ago...
Agreed. However, the problem is that assessing what changes
belongs to fetish and what means actually a fix is hard
and requires experience. Thus, if I will stick to "fetish, no fix"
policy, as unexperienced programmer, I can easily overlook
serious issues.
It's not black and white, rather a gray area.
Best regards,
-- Mateusz Loskot http://mateusz.loskot.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk