[fpc-devel] C library header - var vs pointer for function arguments

Marco van de Voort fpc at pascalprogramming.org
Thu Aug 4 13:58:03 CEST 2022

On 4-8-2022 07:40, Michael Van Canneyt via fpc-devel wrote:
> It's best to use pointers, but you can always provide overloads with var
> arguments.
IIRC it is best to not do this automatically for functions with two such 
cases (two by ref, so var or pointer parameters).

This because small programming mistakes then often trigger "can't 
determine which overloaded function to call", which is often confusing 
for people.

In the Windows headers (rtl/win/wininc and winunits*) I therefore only 
overload with VAR when it is needed for some compatibility reasons 
(either FPC self compatibility or Delphi)

More information about the fpc-devel mailing list