[fpc-devel] Unreachable code warnings
micha at neli.hopto.org
Sun Oct 14 20:34:11 CEST 2007
Daniël Mantione wrote:
> It is justified to warn, since in some cases an error situation can occur
> but the way the check is written causes a dead code check. We found a few
> of these in the compiler sources.
A warning should always be fixable and doing so, turning it into correct
code. The compiler is simply wrong here; my code is correct, so it
should not complain.
It's not the compiler's responsibility that the code is correct; that is
my responsibility, but if it knows for sure it can help me. It's a bit
like the uninitialized variable warning, which the compiler can't know
for sure as well.
More information about the fpc-devel