[fpc-devel] Unreachable code warnings

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Oct 14 22:40:33 CEST 2007


On 14 Oct 2007, at 22:25, Florian Klaempfl wrote:

> Jonas Maebe schrieb:
>>
>> On 14 Oct 2007, at 22:06, Daniƫl Mantione wrote:
>>
>>> I can follow your reasoning why you want the dead code, but on  
>>> the other
>>> hand the warning is there with good reason.
>>
>> Maybe it would better be a hint.
>
> With the same reasoning you could make every warning a hint.

I don't think so. While there may be false "uninitialised" warnings  
(because the compiler simply missed the initialisation somehow),  
every use of an uninitialised variable is an error.

However, not every case of an if-expression which can evaluated at  
compile time is an error. I even don't think the majority is.

> Instead of
> if one usually uses asserts to check certain conditions.

These constructions can also be used instead of ifdefs, even though  
ifdefs are probably also more often used. Using if's instead is   
however not wrong imho.


Jonas




More information about the fpc-devel mailing list