Re: [fpc-devel] Type Compatibility: dynarray <=> Pointer

2018-04-16 Thread Thorsten Engler
A zero length dynamic array is represented by a nil pointer instead of a pointer to the heap with the information that the length of the array is 0. arr := nil; is equivalent to: SetLength(arr, 0); And the nil assignment variant is pretty much ubiquitous in any code involving dynamic arrays

[fpc-devel] Type Compatibility: dynarray <=> Pointer

2018-04-16 Thread Martok
Hi all, I have started debugging 0031215, and discovered something slightly unrelated, but odd. I hope someone can clear that up. While testing, I found out that the following compiles, and becomes a call to fpc_dynarray_assign: var arr: array of byte; begin arr:= Pointer(42); end. This

Re: [fpc-devel] Adding new message to compiler on Windows

2018-04-16 Thread Ondrej Pokorny
On 16.04.2018 16:31, Tomas Hajny wrote: On Mon, April 16, 2018 16:27, Ondrej Pokorny wrote: On 16.04.2018 16:27, Tomas Hajny wrote: There are two commands separated by a semicolon, in fact - have you tried simply calling 'make msg' in the compiler directory? Yes, I did. What did you get

Re: [fpc-devel] Adding new message to compiler on Windows

2018-04-16 Thread Tomas Hajny
On Mon, April 16, 2018 16:27, Ondrej Pokorny wrote: > On 16.04.2018 16:27, Tomas Hajny wrote: >> There are two commands separated by a semicolon, in fact - have you >> tried simply calling 'make msg' in the compiler directory? > > Yes, I did. What did you get then? Tomas

Re: [fpc-devel] Adding new message to compiler on Windows

2018-04-16 Thread Ondrej Pokorny
On 16.04.2018 16:27, Tomas Hajny wrote: There are two commands separated by a semicolon, in fact - have you tried simply calling 'make msg' in the compiler directory? Yes, I did. Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] Adding new message to compiler on Windows

2018-04-16 Thread Tomas Hajny
On Mon, April 16, 2018 15:04, Ondrej Pokorny wrote: Hello, > how can I add a new compiler error message to fpc on Windows? > > The tutorial http://wiki.lazarus.freepascal.org/Message_files didn't > help me because the command > > cd fpc/compiler; make msg > > is invalid on windows. There are

[fpc-devel] Adding new message to compiler on Windows

2018-04-16 Thread Ondrej Pokorny
Hello, how can I add a new compiler error message to fpc on Windows? The tutorial http://wiki.lazarus.freepascal.org/Message_files didn't help me because the command cd fpc/compiler; make msg is invalid on windows. Ondrej ___ fpc-devel maillist

Re: [fpc-devel] Creating Generic Object

2018-04-16 Thread Sven Barth via fpc-devel
Bart schrieb am Mo., 16. Apr. 2018, 12:18: > On Mon, Apr 16, 2018 at 7:53 AM, Sven Barth via fpc-devel > wrote: > > >> This is very nice feature since I do not need define every Map/List/etc > >> as a separate type. > > > Just declare a

Re: [fpc-devel] Creating Generic Object

2018-04-16 Thread Bart
On Mon, Apr 16, 2018 at 7:53 AM, Sven Barth via fpc-devel wrote: >> This is very nice feature since I do not need define every Map/List/etc >> as a separate type. > Just declare a type for the specialization: The obvious (and correct answer) but, this is