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

2018-04-17 Thread Stefan Glienke
That compiles as well because Pointer(0) is converted by the compiler to nil. There is even a dedicated warning for this when used in a const: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/W1013_Constant_0_converted_to_NIL_(Delphi) Am 17.04.2018 um 13:24 schrieb Martok: Am 17.04.2018 um

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

2018-04-17 Thread Martok
Am 17.04.2018 um 11:52 schrieb Stefan Glienke: > FWIW this has been changed in Delphi 10.2 and does not compile anymore but > gives: > E2010 Incompatible types: 'Dynamic array' and 'Pointer' That is what I would have expected. Could you please test what the following does in D10.2? var arr:

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

2018-04-17 Thread Stefan Glienke
FWIW this has been changed in Delphi 10.2 and does not compile anymore but gives: E2010 Incompatible types: 'Dynamic array' and 'Pointer' > On 16 April 2018 at 17:21 Martok wrote: > > > Hi all, > > I have started debugging 0031215, and discovered something slightly

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

2018-04-17 Thread Martok
Am 17.04.2018 um 01:51 schrieb Thorsten Engler: > And the nil assignment variant is pretty much ubiquitous in any code > involving dynamic arrays that I'm aware of. Yes. I know ;-) >> only the reserved/constant "nil" is compatible, and handled elsewhere I asked specifically about assigning

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

2018-04-16 Thread Thorsten Engler
that I'm aware of. > -Original Message- > From: fpc-devel <fpc-devel-boun...@lists.freepascal.org> On Behalf > Of Martok > Sent: Tuesday, 17 April 2018 01:21 > To: fpc-devel@lists.freepascal.org > Subject: [fpc-devel] Type Compatibility: dynarray <=> Po

[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