Use of "var" instead of "out"
Original Reporter info from Mantis: ilyalyu
-
Reporter name: Ilya Lyubinskiy
Original Reporter info from Mantis: ilyalyu
- Reporter name: Ilya Lyubinskiy
Description:
I think such functions as FD_Zero and FileRead should use "out" instead of "var" parameters. I.e.:
procedure FD_Zero(out fds: fdSet);
function FileRead(Handle: THandle; out Buffer; Count: LongInt):LongInt;
instead of:
procedure FD_Zero(var fds: fdSet);
function FileRead(Handle: THandle; var Buffer; Count: LongInt):LongInt;
For example, when you pass an uninitialized fdSet to FD_Zero, the compiler issues a hint that the variable is not initialized. Obviousely, this hint is wrong and useless, and it can be disabled by changing var -> out.
Mantis conversion info:
- Mantis ID: 11263
- Version: 2.2.0
- Fixed in version: 2.4.2
- Fixed in revision: 15042 (#b2d7b4b4)