Wrong docs: not initialized global variables
Original Reporter info from Mantis: kluug.net @onpok
-
Reporter name: Ondrej Pokorny
Original Reporter info from Mantis: kluug.net @onpok
- Reporter name: Ondrej Pokorny
Description:
https://www.freepascal.org/docs-html/ref/refse24.html
There it says:
By default, simple variables in Pascal are not initialized after their declaration. Any assumption that they contain 0 or any other default value is erroneous: They can contain rubbish.
This is not correct. All global (including simple) variables are always initialized: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Variables_(Delphi) "If you do not explicitly initialize a global variable, the compiler initializes it to 0."
Probably you forgot to add a note about global variables.
Note: I don't know and didn't test if the compiler really initializes global variables.
Mantis conversion info:
- Mantis ID: 33558
- Fixed in version: 3.1.1
- Fixed in revision: 1479 (#658f2834)
- Target version: 3.2.0