Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Ondrej Pokorny via fpc-devel
On 31.08.2023 17:54, Tomas Hajny via fpc-devel wrote: On 2023-08-31 17:08, Ondrej Pokorny via fpc-devel wrote: :) We are not at the finish yet. Positive outcome will be when it gets fixed in the compiler source. Yes, I know. I checked your patch briefly now and I don't like the fact

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Ondrej Pokorny via fpc-devel
Am 31.08.2023 um 9:59 schrieb Tomas Hajny via fpc-devel: On 2023-08-30 23:38, Ondrej Pokorny via fpc-devel wrote: Am 30.08.2023 um 20:21 schrieb Ondrej Pokorny via fpc-devel: Having seen the outputs, I think that the compiler just ignores the source file encoding for {$MESSAGE} and {$NOTE

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
Am 30.08.2023 um 20:21 schrieb Ondrej Pokorny via fpc-devel: On 30.08.2023 17:35, Tomas Hajny via fpc-devel wrote: On 2023-08-30 17:23, Ondrej Pokorny via fpc-devel wrote: Sorry to bother you with something as trivial: is your t2.pas file really encoded in UTF-8? Because if I compile an ANSI

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:35, Tomas Hajny via fpc-devel wrote: On 2023-08-30 17:23, Ondrej Pokorny via fpc-devel wrote: Sorry to bother you with something as trivial: is your t2.pas file really encoded in UTF-8? Because if I compile an ANSI file with the {$codepage utf8} declaration, then I get

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:04, Tomas Hajny via fpc-devel wrote: On 2023-08-30 16:32, Ondrej Pokorny via fpc-devel wrote: If you mean https://stackoverflow.com/questions/56419639/what-does-beta-use-unicode-utf-8-for-worldwide-language-support-actually-do, then no, I don't have this option checked

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:04, Tomas Hajny via fpc-devel wrote: On 2023-08-30 16:32, Ondrej Pokorny via fpc-devel wrote: If you mean https://stackoverflow.com/questions/56419639/what-does-beta-use-unicode-utf-8-for-worldwide-language-support-actually-do, then no, I don't have this option checked

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 16:23, Tomas Hajny via fpc-devel wrote: On 2023-08-30 15:26, Ondrej Pokorny via fpc-devel wrote: On 30.08.2023 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your output is different from mine (using a freshly compiled trunk compiler): Free Pascal Compiler version 3.3.1 [2023

[fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-28 Thread Ondrej Pokorny via fpc-devel
Hello, when compiling a program with fpc on Windows, fpc seems to have the console output encoding wrong. Example program (I am using "ä" because I am on german OS, so "ä" is in my DOS Latin and also in my ANSI codepage): {$codepage utf8} program TestNote; begin {$note ä} end. The console

Re: [fpc-devel] Memory leak: bug ot as designed?

2023-03-29 Thread Ondrej Pokorny via fpc-devel
Nice one :) I am also interested in the answer. IMO it is a bug because the code is valid - https://www.freepascal.org/docs-html/ref/refse10.html FYI: Delphi doesn't create a memory leak. Ondrej ___ fpc-devel maillist -

Re: [fpc-devel] Unexpected "Range check error while evaluating constants" when compiling for Win64

2023-02-12 Thread Ondrej Pokorny via fpc-devel
On 12.02.2023 23:08, Bart via fpc-devel wrote: On Sun, Feb 12, 2023 at 10:47 PM Jonas Maebe via fpc-devel wrote: Afaik it's because "default" doesn't support qword values, iirc because of (at least old) Delphi compatibility. OK, I removed the "default". Theoretically would that lead to

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 14:22, Sven Barth via fpc-devel wrote: Only because you can't see a reason for it doesn't mean that it doesn't exist. That is exactly why I asked :) Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 12:19, Marco van de Voort via fpc-devel wrote: On 2-2-2023 12:00, Ondrej Pokorny via fpc-devel wrote: The only disadvantage is that you get a FreeAndNil copy for every type you pass into the parameter (?) Are they actually made global ? Will two freeandnil in different units use

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 12:25, Mattias Gaertner via fpc-devel wrote: On Thu, 2 Feb 2023 12:00:31 +0100 Ondrej Pokorny via fpc-devel wrote: [...] Delphi cannot do it. FPC rocks! +1 The only disadvantage is that you get a FreeAndNil copy for every type you pass into the parameter (?) Do we want

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 11:00, Michael Van Canneyt via fpc-devel wrote: In userspace, the best seems Function FreeAndNil(Obj : T) : T; begin   Obj.Free;   Result:=Nil; end; With automatic type inference for generics, this allows you to do A:=FreeAndNil(A); Michael, bringing your idea to the next

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 10:22, Michael Van Canneyt via fpc-devel wrote: On Thu, 2 Feb 2023, Ondrej Pokorny via fpc-devel wrote: On 02.02.2023 10:15, Michael Van Canneyt via fpc-devel wrote: On Thu, 2 Feb 2023, Ondrej Pokorny via fpc-devel wrote: I myself cannot think of any real use case of constref

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 10:15, Michael Van Canneyt via fpc-devel wrote: On Thu, 2 Feb 2023, Ondrej Pokorny via fpc-devel wrote: I myself cannot think of any real use case of constref other than hacks like the FreeAndNil in recent Delphi versions: procedure FreeAndNil(const [ref] Obj: TObject

Re: [fpc-devel] Question on constref

2023-02-02 Thread Ondrej Pokorny via fpc-devel
On 02.02.2023 07:42, Sven Barth via fpc-devel wrote: The case when you *need* a constant reference. Case in point: the passing of TGuid in IInterface.QueryInterface. Delphi code relies on it being a reference, but “const” does not guarantee that for all platforms. Maybe I am missing

Re: [fpc-devel] Function to find if IP address is local

2023-01-09 Thread Ondrej Pokorny via fpc-devel
On 09.01.2023 09:08, Michael Van Canneyt wrote: On Mon, 9 Jan 2023, Ondrej Pokorny via fpc-devel wrote: Is there a routine in RTL to find out if a given IPv4 address is from the private address range (10.* etc)? No, not to my knowledge. Feel free to add it somewhere in fcl-net. Here

[fpc-devel] Function to find if IP address is local

2023-01-09 Thread Ondrej Pokorny via fpc-devel
Hello! Is there a routine in RTL to find out if a given IPv4 address is from the private address range (10.* etc)? Thanks Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] threads vs widestringmanager / crash

2022-12-21 Thread Ondrej Pokorny via fpc-devel
On 20.12.2022 21:12, Sven Barth via fpc-devel wrote: Please stop focusing on the WideString manager. That is simply a symptom. The real cause is that a thread is created where there shouldn't be one and under normal circumstance there indeed will be none: - if the initialization is executed as

Re: [fpc-devel] threads vs widestringmanager / crash

2022-12-19 Thread Ondrej Pokorny via fpc-devel
On 19.12.2022 09:51, Michael Van Canneyt via fpc-devel wrote: If you can prepare a simple sample program that shows the problem, I can try to look into it. Maybe a fresh pair of eyes sees more than one pair of eyes? You don't need a special sample program. Every console application on Windows

Re: [fpc-devel] threads vs widestringmanager / crash

2022-12-18 Thread Ondrej Pokorny via fpc-devel
On 19.12.2022 07:42, Sven Barth via fpc-devel wrote: The RTL assumes that it does not have to deal with threads during the initialization of the System unit. So even if the symptom of the crash is fixed in that location it isn't said that something else might crash or that in the future code

Re: [fpc-devel] threads vs widestringmanager / crash

2022-12-17 Thread Ondrej Pokorny via fpc-devel
I have the same problem. It is very annoying because programs crash quite often when run in a debugger (on Windows). I solved it with the attached patch - I added these lines to procedure OpenStdIO(var f:text;mode:longint;hdl:thandle);   {$if defined(FPC_HAS_CPSTRING) and

Re: [fpc-devel] Sorting tests

2022-11-29 Thread Ondrej Pokorny via fpc-devel
Am 29.11.2022 um 14:25 schrieb Sven Barth via fpc-devel: For such a comparison function the issue is indeed in the comparison function, but Nikolay also mentioned "ais the case for equal elements. I assume this was some kind of typo or reasoning error because "acompare function is correct.

Re: [fpc-devel] Sorting tests

2022-11-29 Thread Ondrej Pokorny via fpc-devel
Am 29.11.2022 um 11:08 schrieb Sven Barth via fpc-devel: J. Gareth Moreton via fpc-devel schrieb am Di., 29. Nov. 2022, 10:09: Surely that's a bug in the comparison functions that should be fixed and not something that can be blamed on introsort.  If a comparison function

Re: [fpc-devel] Just need to double check the size of Integer

2022-11-24 Thread Ondrej Pokorny via fpc-devel
Am 24.11.2022 um 14:44 schrieb Tomas Hajny via fpc-devel: On 2022-11-24 14:25, Ondrej Pokorny via fpc-devel wrote: Am 24.11.2022 um 14:15 schrieb Marco van de Voort via fpc-devel: On 24-11-2022 14:13, J. Gareth Moreton via fpc-devel wrote: I just need to double-check something.  Under CPU16

Re: [fpc-devel] Just need to double check the size of Integer

2022-11-24 Thread Ondrej Pokorny via fpc-devel
Am 24.11.2022 um 14:15 schrieb Marco van de Voort via fpc-devel: On 24-11-2022 14:13, J. Gareth Moreton via fpc-devel wrote: I just need to double-check something.  Under CPU16, SizeInt and SizeUInt are declared as follows:   SizeInt = Integer;   SizeUInt = Word; Is Integer 16-bit in this

Re: [fpc-devel] Just need to double check the size of Integer

2022-11-24 Thread Ondrej Pokorny via fpc-devel
Am 24.11.2022 um 14:15 schrieb Marco van de Voort via fpc-devel: On 24-11-2022 14:13, J. Gareth Moreton via fpc-devel wrote: I just need to double-check something.  Under CPU16, SizeInt and SizeUInt are declared as follows:   SizeInt = Integer;   SizeUInt = Word; Is Integer 16-bit in this

Re: [fpc-devel] Compile error with actual FPC main and Lazarus main

2022-09-28 Thread Ondrej Pokorny via fpc-devel
Am 28.09.2022 um 18:53 schrieb Gabor Boros via fpc-devel: 2022.09.28. 17:43 keltezéssel, Ondrej Pokorny via fpc-devel írta: Try a clean build. Ondrej Clean build is ok. The problem appears when use "Build Lazarus with Profile: Normal IDE". That is quite normal. If you see s

Re: [fpc-devel] Compile error with actual FPC main and Lazarus main

2022-09-28 Thread Ondrej Pokorny via fpc-devel
Am 28.09.2022 um 12:53 schrieb Gabor Boros via fpc-devel: Hi All, With actual FPC (123f196d) and Lazarus (11bb7ce4) got the below error. Any idea? sourcefilemanager.pas(311,1) Error: Compilation raised exception internally Try a clean build. Ondrej

[fpc-devel] Fwd: [Lazarusdev] Moving issue 39853 to FPC project

2022-08-18 Thread Ondrej Pokorny via fpc-devel
Hello it looks like only people with FPC developer status can move issues to the FPC project. Therefore I forward the request to fpc-devel. Ondrej Weitergeleitete Nachricht Betreff:[Lazarusdev] Moving issue 39853 to FPC project Datum: Thu, 18 Aug 2022 03:51:33 +0300

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Ondrej Pokorny via fpc-devel
Am 16.08.2022 um 13:19 schrieb Michael Van Canneyt via fpc-devel: On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote: --- code end Run it in Delphi and FPC and compare the outputs: Delphi output: PropCount: 0 Property info is null FPC output: PropCount: 1 Property name: Fruit Property

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Ondrej Pokorny via fpc-devel
Am 16.08.2022 um 09:37 schrieb Michael Van Canneyt via fpc-devel: On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote: On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel < fpc-devel@lists.freepascal.org> wrote: fpc code is still "unexpected". It takes into account the MinValue type

Re: [fpc-devel] tkLString vs tkAString

2021-11-30 Thread Ondrej Pokorny via fpc-devel
On 30.11.2021 13:43, Marc Weustink via fpc-devel wrote: On 30-11-2021 13:37, Michael Van Canneyt via fpc-devel wrote: On Tue, 30 Nov 2021, Marc Weustink via fpc-devel wrote: Hi, I ran into an issue with a piece of ported Delphi (6) code and RTTI. Part of the Delphi code was based on strings

Re: [fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-09-28 Thread Ondrej Pokorny via fpc-devel
On 28.09.2020 16:05, Michael Van Canneyt wrote: On Mon, 28 Sep 2020, Ondrej Pokorny via fpc-devel wrote: On 28.09.2020 15:34, Michael Van Canneyt via fpc-devel wrote: I made some time for this, it's checked in with revision 46987. Note that this revision also enables support for LibreSSL

Re: [fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-09-28 Thread Ondrej Pokorny via fpc-devel
On 28.09.2020 15:34, Michael Van Canneyt via fpc-devel wrote: I made some time for this, it's checked in with revision 46987. Note that this revision also enables support for LibreSSL (or whatever it is called) versions on linux/mac systems. Thank you for your patch, and I'm sorry that it

Re: [fpc-devel] Another thread about the fact that official FPC releases are *unnecessarily* non-representative of the platforms it actually runs on

2020-09-28 Thread Ondrej Pokorny via fpc-devel
On 27.09.2020 23:45, Travis Siegel via fpc-devel wrote: On 9/27/2020 3:50 PM, Florian Klämpfl via fpc-devel wrote: - there are little libraries being really IEEE compliant for float128 - if they are IEEE compliant, their license does not allow to use the code in the FPC rtl. I don't

Re: [fpc-devel] TThread.RemoveQueuedEvents

2020-09-25 Thread Ondrej Pokorny via fpc-devel
On 25.09.2020 03:30, Martin via fpc-devel wrote: Wath is in the following indented? The doc says https://www.freepascal.org/docs-html/rtl/classes/tthread.removequeuedevents.html all calls to the given method are removed. However there may be more than one way to read this. aMethod:

Re: [fpc-devel] about #0035991, fpc 3.2.1 still crash lazarus 2.0.10, 2.0.11

2020-09-02 Thread Ondrej Pokorny via fpc-devel
Hello Bald, it is not possible to support the latest FPC trunk in already released Lazarus versions (2.0.10). If you want some bug fixes to be merged into the stable branch (currently 2.0.11), you can list the revisions here: https://wiki.freepascal.org/Lazarus_2.0_fixes_branch I did it