[fpc-devel] Local boolean variables not always initalized with false by default?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 16 11:42:25 CEST 2009


On 16 Sep 2009, at 10:34, theo wrote:

> While uninitialized variables are certainly a bad thing, it's still a
> bit strange why it defaults to 'true' in this case.
> It was 'false' with Delphi.

Uninitialised means exactly that: not initialised, neither with false,  
nor with true (both in Delphi and FPC). What you get is whatever  
random value happens to be in stack memory at that location, based on  
what previously executed code stored there.


Jonas



More information about the fpc-devel mailing list