Error message for unreachable code

Walter Bright newshound at digitalmars.com
Tue Apr 11 09:58:27 PDT 2006


Oskar Linde wrote:
> I see this as an interesting case of where DMD issues an error for valid 
> code, where a typical C compiler at most would issue a warning. The 
> generated code (with or without const folding) will be correct. I would 
> like to hear why DMD considers the above an error while for instance 
> functions without return values are not.

It comes about from constant folding. It would be difficult for the 
compiler to tell that this code is unreachable.



More information about the Digitalmars-d mailing list