Re: [fpc-pascal] Name collisions in scoped enums

2020-05-03 Thread Sven Barth via fpc-pascal
Am 04.05.2020 um 05:06 schrieb Ryan Joseph via fpc-pascal: I've been using scoped enums and noticed that I'm getting collisions with reserved keywords. Shouldn't these be allowed in scoped enums since they are required to be referenced using their type name as a prefix? No, keywords have a

[fpc-pascal] Name collisions in scoped enums

2020-05-03 Thread Ryan Joseph via fpc-pascal
I've been using scoped enums and noticed that I'm getting collisions with reserved keywords. Shouldn't these be allowed in scoped enums since they are required to be referenced using their type name as a prefix? {$mode objfpc} program test; {$scopedenums on} // error: Syntax error,

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
On 3/05/20 10:28 pm, Michael Van Canneyt wrote: Yes, please open a bug report. If you attach a small console test program that demonstrates the bug (and subsequently the fix) then I will make sure it ends up in the correct place. If you make sure it exits with exit code 0 if all is well,

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: The problem is that the StrToHostAddr6 function doesn't set its return value until the end of the function. If a

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: The problem is that the StrToHostAddr6 function doesn't set its return value until the end of the function. If a parse error occurs mid-function, it zeroes the record in

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Ryan Joseph via fpc-pascal wrote: On May 3, 2020, at 4:04 PM, Michael Van Canneyt wrote: Just set the Collection property of the items to the concatenated collection instance. Note that this effectively moves the items. That means I'll need to set it back later

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Ryan Joseph via fpc-pascal
> On May 3, 2020, at 4:04 PM, Michael Van Canneyt > wrote: > > Just set the Collection property of the items to the concatenated collection > instance. > > Note that this effectively moves the items. That means I'll need to set it back later right? The original lists are being kept alive

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Ryan Joseph via fpc-pascal wrote: I have many TCollection's that I need to concat together into one larger collection for streaming. Since it's just a list I thought I could add the elements together but it appears TCollection requires that it allocate each item. Is

[fpc-pascal] Concat TCollection?

2020-05-03 Thread Ryan Joseph via fpc-pascal
I have many TCollection's that I need to concat together into one larger collection for streaming. Since it's just a list I thought I could add the elements together but it appears TCollection requires that it allocate each item. Is there a way to do this without relocating each item of the

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: Using fpc 3.0.4 on Fedora 30. I've just started using the StrToHostAddr6 function in the sockets unit to parse IPv6 addresses. I've found a couple of issues with it. 1. Even if address parsing fails, StrToHostAddr6 doesn't return an

[fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
Using fpc 3.0.4 on Fedora 30. I've just started using the StrToHostAddr6 function in the sockets unit to parse IPv6 addresses. I've found a couple of issues with it. 1. Even if address parsing fails, StrToHostAddr6 doesn't return an all-zero result in the in6_addr return value. The