Boost logo

Boost :

Subject: Re: [boost] suggestion on assertion macros
From: DE (satan66613_at_[hidden])
Date: 2010-03-16 13:47:10


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.)

the code you acquire and expect it to work right out of the box may
confuse you with warnings and waste your time while figuring out
i believe this is especially true about novice programmers

pushing\popping warnings in EVERY source file is not an option imho

so yes, leaving unreachable code is a bad habit (imho)
i would restructure code not to cause any warnings if possible (it is
almost always so)

-- 
Pavel

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