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

2022-08-04 Thread Marco van de Voort via fpc-devel
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

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

2022-08-04 Thread gabor via fpc-devel
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.

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

2022-08-04 Thread gabor via fpc-devel
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 -

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

2022-08-03 Thread Michael Van Canneyt via fpc-devel
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)?

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

2022-08-03 Thread Dmitry Boyarintsev via fpc-devel
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

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

2022-08-03 Thread gabor via fpc-devel
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