Should unreachable code be considered an error?

Stewart Gordon smjg_1998 at yahoo.com
Sun Oct 2 14:18:36 PDT 2011


On 20/09/2011 09:17, Rory McGuire wrote:
> Perhaps a warning, there are to many ways to make "unreachable" code reachable. In other
> words, it is surely too much work to implement currently.
<snip top of upside-down reply>

If the compiler can optimise away code that will never run because no arrow in the 
flowchart leads to it, why can't it just as well generate an error on the same code?

Simply because we can't rely on every compiler to perform even the most basic cases of DCE?

Stewart.


More information about the Digitalmars-d mailing list