[fpc-devel] Wrong docs: not initialized global variables

Jonas Maebe jonas at freepascal.org
Wed Apr 4 18:53:13 CEST 2018


On 04/04/18 18:44, Ondrej Pokorny wrote:
> I want to stress that the compiler emits a warning on code that does not 
> have (and also cannot have) an error

An error is wrong code behaviour. If you do not initialise a variable 
with the correct value, then you can have an error. This correct value 
can be different from "empty string" or "nil".

For the same reason, we also warn about uninitialised global variables 
(if this can be detected without interprocedural analysis, i.e., if they 
are only used in the main program code; but that is merely due to a 
limitation of the analysis).


Jonas



More information about the fpc-devel mailing list