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
W dniu 2022-08-04 o 07:40, Michael Van Canneyt via fpc-devel pisze:
It's best to use pointers, but you can always provide overloads with var
arguments.
And as Dmitry Boyarintsev pointed out, don't change existing signatures for
backwards compatibility.
Michael.
Thanks. I'll use pointers.
W dniu 2022-08-04 o 02:18, Dmitry Boyarintsev pisze:
Consider backwards compatibility in fixes
Good point, thanks. However, I mean non-existent / incorrect / not
up-to-date declarations.
Michał.
___
fpc-devel maillist -
On Thu, 4 Aug 2022, gabor via fpc-devel wrote:
I'd like to provide some fixes for packages that are headers for c
libraries. When and should I use the "var" argument for function
arguments that return a value, or should I always use pointers
(excluding arguments that might accept nil)?
Consider backwards compatibility in fixes
On Wednesday, August 3, 2022, gabor via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
> I'd like to provide some fixes for packages that are headers for c
> libraries. When and should I use the "var" argument for function arguments
> that return a
I'd like to provide some fixes for packages that are headers for c
libraries. When and should I use the "var" argument for function
arguments that return a value, or should I always use pointers
(excluding arguments that might accept nil)?
Eg:
function Foo(var A: Integer): Integer;
vs