Should unreachable code be considered an error?

Nick Sabalausky a at a.a
Thu Aug 18 10:29:24 PDT 2011


"Bernard Helyer" <b.helyer at gmail.com> wrote in message 
news:j2ithq$12kd$1 at digitalmars.com...
>I asked the Ars forums ( http://arstechnica.com/civis/viewtopic.php?
> f=20&t=1153378&p=21965411 ) and I ask the same of you: should
> unambiguously unreachable code be an error or a warning? ( see the linked
> forum post for more details ).

No. That would be a royal pain in the ass during debugging. I expect to be 
able to stick a "return xxxx;" anywhere I want to test something and not 
have the compiler crap out because I didn't deal with the overhead of 
commenting out the rest.

A warning might be nice, though.




More information about the Digitalmars-d mailing list