Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Marco van de Voort via fpc-pascal
Op 2-5-2024 om 08:32 schreef Adriaan van Os via fpc-pascal: TWindow(myClass).CreateNewWindow; And this is what crashes. I can report this, if the type-cast is supposed to work. Known gotcha. Is and as are no good for method variables, use: if myclass.inheritsfrom(twindow) then    

Re: [fpc-pascal] AnsiString address changed

2024-03-18 Thread Marco van de Voort via fpc-pascal
Op 18-3-2024 om 09:27 schreef Hairy Pixels via fpc-pascal: do that, you'll have the same output 3 times. Oh, it's a pointer to a pointer? No, it is a pointer variable, but you take the address (@) of that pointer, which causes the second indirection

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Marco van de Voort via fpc-pascal
Op 14-3-2024 om 11:52 schreef Tomas Hajny via fpc-pascal: "OK, that would be addressed in case of inclusion under utils as well. Even more so, actually - users who want to recompile packages for whatever reason (e.g. to have debug information included as discussed here recently ;-) )

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Marco van de Voort via fpc-pascal
Op 14-3-2024 om 11:04 schreef Michael Van Canneyt via fpc-pascal: To me it therefore seems a better idea to move the IDE to utils, and to have a toplevel make command that does the same as 'make all' simply without the utilities. Or have a 'NOUTILS=1' define. Or let fpmake simply build

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Marco van de Voort via fpc-pascal
Op 14-3-2024 om 09:34 schreef Guillermo Martínez Jiménez via fpc-pascal: Thanks, Karoly and Marco. I thought "packages" were libraries not applications, as there is an "utils" directory with programs. Roughly the RTL is a base set of units needed for the compiler itself. When the compiler

Re: [fpc-pascal] FP IDE sources

2024-03-13 Thread Marco van de Voort via fpc-pascal
Op 13-3-2024 om 21:34 schreef Karoly Balogh via fpc-pascal: H Where are they? Why aren't with the official source packages? But they are. The IDE code is here: https://gitlab.com/freepascal.org/fpc/source/-/tree/main/packages/ide It also depends on Free Vision, which is here:

Re: [fpc-pascal] Floating point question

2024-02-22 Thread Marco van de Voort via fpc-pascal
Op 22-2-2024 om 15:08 schreef Thomas Kurz via fpc-pascal: If you're using Win64, then the answer is simple: x86_64-win64 unlike any other x86 target does not support Extended, so neither the compiler nor the code in runtime will ever calculate anything with that precision. That's another

Re: [fpc-pascal] Floating point question

2024-02-13 Thread Marco van de Voort via fpc-pascal
Op 13-2-2024 om 11:39 schreef Bernd Oppolzer via fpc-pascal: But, sorry, because we are talking about compile time math, performance (nanoseconds) in this case doesn't count, IMO. But probably compiled code is then automatically upscaled to the higher type too, since if one of the terms

Re: [fpc-pascal] IntToStr implementation

2024-01-17 Thread Marco van de Voort via fpc-pascal
Op 17-1-2024 om 15:57 schreef Hairy Pixels via fpc-pascal: Can anyone show me where to find the IntToStr implementation in SysUtils? There's so many level of indirection and macros I have no idea where to look for it! Grep rtl/objpas/sysutils for it. sysstr.inc for the implementation

Re: [fpc-pascal] What's in Hello World

2024-01-08 Thread Marco van de Voort via fpc-pascal
Op 7-1-2024 om 16:09 schreef Travis Siegel via fpc-pascal: Not that it's 100 percent relevant, but I always use powerbasic (https://www.powerbasic.com) when it's a matter of size, I also never use powerbasic. ___ fpc-pascal maillist -

Re: [fpc-pascal] What's in Hello World

2024-01-08 Thread Marco van de Voort via fpc-pascal
Op 8-1-2024 om 14:03 schreef Karoly Balogh via fpc-pascal: No, it's not. But the Linker specific options are under Options -> Linker... There's a smartlinking related option there, but I'm not sure if it is what you need. :) That one is -XX, and the "create smartlinkable units" in the tab

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Marco van de Voort via fpc-pascal
Op 7-1-2024 om 11:23 schreef Sven Barth via fpc-pascal: To underline this with some numbers (I assume you mean the demo/text/hello.pp which only contains a mere "Writeln('Hello World')" and no additional units; all tests on x86_64-linux with 3.3.1): - FPC compiled as is: 388976 B - FPC

Re: [fpc-pascal] How to avoid Copy

2023-12-31 Thread Marco van de Voort via fpc-pascal
Op 31/12/2023 om 04:11 schreef Amir--- via fpc-pascal: I compiled the code with `fpc -O3 -Sd -gv -g -gl ` and ran `valgrind` on it (the output is attached). It does not look like there is a big difference between the Check1 and Check2 but Check3 is about 20 times faster than the other two.

Re: [fpc-pascal] Daily snapshots?

2023-12-29 Thread Marco van de Voort via fpc-pascal
Op 27/12/2023 om 12:38 schreef Thomas Kurz via fpc-pascal: as it seems to take longer for the next major release, I'd appreciate if automated snapshots could be provided either daily or weekly. In the documentation, I found a link to ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/ but I

Re: [fpc-pascal] Does the compiler make prodigious use of use ENTER instruction?

2023-12-12 Thread Marco van de Voort via fpc-pascal
Op 12-12-2023 om 17:48 schreef Anthony Walter via fpc-pascal: Iwas reading this article today on the Microsoft website about the mysterious x86 ENTER instruction. The article states that it's primary purpose is to support Pascal and similar compilers to allow for preserving local variables on

Re: [fpc-pascal] Program crash - read the error messages

2023-09-01 Thread Marco van de Voort via fpc-pascal
On 1-9-2023 15:43, Rainer Stratmann via fpc-pascal wrote: Where can I find the output of the error messages if a program crashes. There is another program that still is running. I want to read the error messages automatically if that is possible. How do you start it? TProcess, Runcommand

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-27 Thread Marco van de Voort via fpc-pascal
On 26-6-2023 21:39, Michael Van Canneyt via fpc-pascal wrote:  (afaik 3.2.2's comobj does this automatically, in older version YMMV). Well, I checked prior to sending my answer. If it does this, it's well hidden. There seems to be some hook for it, though. It hooks initproc into a linked

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Marco van de Voort via fpc-pascal
On 26-6-2023 20:26, Michael Van Canneyt via fpc-pascal wrote: I suspect COM is not properly initialized, and that Lazarus does this for you. (it needs com for some components on windows) So, try adding unit windows to the uses clause and add CoInitialize(nil); as the first statement of

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Marco van de Voort via fpc-pascal
On 26-6-2023 15:54, Michael Van Canneyt via fpc-pascal wrote:   v.Voice:=v.GetVoices().Item(1); I have to change that to (0) to get it to work. Might depend on configuration? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

2023-06-13 Thread Marco van de Voort via fpc-pascal
On 13-6-2023 15:38, Rafael Picanço via fpc-pascal wrote: Thank you Marco, I am elaborating on top of your suggestions. > The problem is that the logical solution, making it a macro, doesn't work, as macro definitions don't export through USES clauses. I think that pre-processor constants with

Re: [fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

2023-06-13 Thread Marco van de Voort via fpc-pascal
On 13-6-2023 05:19, Rafael Picanço via fpc-pascal wrote: (1) I have no idea on how to translate these god-casts, eg., ((getExButtonStates)0), to free pascal. Right now, I think that even if I don't really need them, I just want to understand and learn in the process. The problem is that the

Re: [fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-12 Thread Marco van de Voort via fpc-pascal
On 12-6-2023 08:15, Nikolay Nikolov via fpc-pascal wrote: Shouldn't the recursive call assign the result? nextt(num - 1); nextt:=nextt(num - 1); if you don't use the result, the whole call may be optimized away? ___ fpc-pascal maillist -

Re: [fpc-pascal] Compile time -> processor benchmark values

2023-05-29 Thread Marco van de Voort via fpc-pascal
On 29-5-2023 16:24, Sven Barth via fpc-pascal wrote: FPC itself is single threaded. So for that the single thread rating is more important. However Lazarus (and fpmake) can parallelize the building of packages if they don't depend on each other. On the other hand this is only really

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-24 Thread Marco van de Voort via fpc-pascal
On 24-5-2023 13:00, Benito van der Zander via fpc-pascal wrote: It is weird that your code calls setjmp? Are you using a non Windows platform?  Comparisons with Delphi should be done on Windows where the exception systems match. Apples to Apples please. It is FPC on Linux. And Delphi 4 on

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-24 Thread Marco van de Voort via fpc-pascal
On 23-5-2023 12:44, Benito van der Zander via fpc-pascal wrote: Hi, Depends on your code. I wrote all my code in Delphi 4. From 1998 or so. I do not make new projects, only maintain old ones. Delphi 4 felt much better. Like take: procedure test; var s: string; begin   s:= 'abc'; end;

Re: [fpc-pascal] Multiple enumerators per class

2023-05-12 Thread Marco van de Voort via fpc-pascal
Op 12/05/2023 om 14:16 schreef Hairy Pixels via fpc-pascal: Is it possible to have multiple enumerators on one class? Yes, see e.g. TDictionary that allows iterations over keys and values and both. There is only one default iterator, but you can have some property that has its own

Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Marco van de Voort via fpc-pascal
On 30-3-2023 07:38, Bo Berglund via fpc-pascal wrote: The problem seems to be that neither is a valid COFF file according to my Fpc (or Lazarus) in any case. Both generate the COFF error when reaching the linker step. 32-bit objs for delphi are typically OMF, 64-bit are typically coff (for

Re: [fpc-pascal] Fpc 3.2.2 fails to "make install" on RPi4 to local directory

2023-03-28 Thread Marco van de Voort via fpc-pascal
On 28-3-2023 13:43, Bo Berglund via fpc-pascal wrote: make install prefix="$HOME" FPC="$HOME/dev/fpc/3.2.2/compiler/ppcarm" It is install_prefix= not install prefix=  iow, insert a underscore ___ fpc-pascal maillist -

Re: [fpc-pascal] Converting old pascal written for Pascal/MT+ compiler

2023-03-28 Thread Marco van de Voort via fpc-pascal
On 28-3-2023 11:33, Karoly Balogh via fpc-pascal wrote: Probably yes, but there might be an alternative, see below. But as far as I understand, Unit is a Turbo Pascal concept, so any Pascal programming dialect that predates it, probably don't understand it. True, and before units in Turbo

Re: [fpc-pascal] Why in {$mode delphi} it works and in {$mode objfpc} it doesn't?

2023-01-16 Thread Marco van de Voort via fpc-pascal
On 16-1-2023 20:56, Giuliano Colla via fpc-pascal wrote: No chance. Addr is a pointer (of type Pin_addr) but Addr := Pin_addr(HostEnt.h_addr^) works only if mode is Delphi. In objfpc it raises exactly the same error. A little bit weird, isn't it? It depends. It assumes .h_addr is

Re: [fpc-pascal] GStreamer API unit added

2022-11-01 Thread Marco van de Voort via fpc-pascal
On 1-11-2022 11:45, Michael Van Canneyt via fpc-pascal wrote: I'm not an expert in sound/video streams, so if someone can contribute a more elaborate example, it would be most welcome :) Did you use gir2pascal ?  Seems there are GIR files for it

Re: [fpc-pascal] pthread_detach

2022-10-30 Thread Marco van de Voort via fpc-pascal
On 30-10-2022 13:05, Hairy Pixels via fpc-pascal wrote: On Oct 30, 2022, at 6:55 PM, Marco van de Voort via fpc-pascal wrote: Yes. They call pthread_detach when ending, i.e. just before calling pthread_exit. So if you use normal threads, you already use that. Similarly, pthread_join

Re: [fpc-pascal] pthread_detach

2022-10-30 Thread Marco van de Voort via fpc-pascal
On 30-10-2022 12:28, Hairy Pixels via fpc-pascal wrote: The POSIX thread library has a function called pthread_detach (https://man7.org/linux/man-pages/man3/pthread_detach.3.html). Do the RTL threads have anything comparable? Yes. They call pthread_detach when ending, i.e. just before

Re: [fpc-pascal] Variants with classes and records

2022-10-06 Thread Marco van de Voort via fpc-pascal
On 6-10-2022 14:16, Sven Barth via fpc-pascal wrote: And that crashed also. I thought it would be ok to just hold the reference but not claim ownership over it. Variants count as managed types and they can contain interface references and strings. If you use a custom type you can do

Re: [fpc-pascal] Enum property can't be published

2022-09-27 Thread Marco van de Voort via fpc-pascal
On 27-9-2022 11:14, Hairy Pixels via fpc-pascal wrote: I just tried to build a lazarus project using 3.3.1/ppca64 and I’m getting an error that an enum can’t be published. This was working on 3.2.2/ppcx64 so what changed? === lazbuild ./pasls.lpi

Re: [fpc-pascal] mciSendString with long file names

2022-09-23 Thread Marco van de Voort via fpc-pascal
On 22-9-2022 21:26, Travis Siegel via fpc-pascal wrote: That's on windows, you said the program was running on linux. Afaik he said he was on Windows, but his files are on a Linux server: James richter Wrote: I just figured out that short filenames won't work, my files are on a linux

Re: [fpc-pascal] BoolToStr

2022-08-28 Thread Marco van de Voort via fpc-pascal
Op 8/28/2022 om 8:45 PM schreef Ralf Quint via fpc-pascal: On 8/28/2022 8:23 AM, James Richters via fpc-pascal wrote: Running "i:\booltostr.exe " -1 0 Why true is -1 instead of 1 is beyond me, but anyway, I would consider this BoolToInt, not BoolToStr,I want the Strings ‘TRUE’ or ‘FALSE’

Re: [fpc-pascal] Class or Record Helper for Interface?

2022-08-27 Thread Marco van de Voort via fpc-pascal
Op 8/27/2022 om 3:06 PM schreef Anthony Walter via fpc-pascal: Ah, it seems the problem is even in {$mode delphi} you must use {$modeswitch typehelpers} to define a type helper for an interface. I put a note on the checklist for the next major version about this to review this. (only

Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-22 Thread Marco van de Voort via fpc-pascal
On 22-8-2022 15:01, Anthony Walter via fpc-pascal wrote: I never thought about the linker changes to FPC and am probably using the internal one. I know in the past I had been able to compile / link libraries created with MinGW GCC on Windows. Parts of the problem also include determining

Re: [fpc-pascal] Here is real time graphics and physics simulation, library

2022-08-01 Thread Marco van de Voort via fpc-pascal
On 1-8-2022 11:12, Michael Van Canneyt via fpc-pascal wrote: Hence my proposal to refactor it in sysutils, so at least the exception handling can be kept common to all units. His main objection seems to be the IFDEFING, which is hard to avoid in a 20 targets + compiler. Also, the

Re: [fpc-pascal] UBER H3 API working/partially converted

2022-08-01 Thread Marco van de Voort via fpc-pascal
On 31-7-2022 15:55, Skybuck Flying via fpc-pascal wrote: (I mainly write this second e-mail to prevent you from wasting time on the previous e-mail, cause the conversion was already quite successfull with a different tool, read below) IIRC h2pas doesn't like calling convention modifiers,

Re: [fpc-pascal] Feature Announcement: Function References and Anonymous Functions

2022-05-27 Thread Marco van de Voort via fpc-pascal
On 27-5-2022 14:12, Sven Barth via fpc-pascal wrote: You couldn't have written a test that's independent of TThread? 梁 When I saw no reactions on core this morning, I dumped everything I had to the respective issue trackers. I'm not sure if I can get all of this reproduced on my private

Re: [fpc-pascal] Feature Announcement: Function References and Anonymous Functions

2022-05-27 Thread Marco van de Voort via fpc-pascal
On 27-5-2022 00:46, Mattias Gaertner via fpc-pascal wrote: As these two features are rather complicated there might still be a huge bundle of bugs lurking around so I ask you to test them to year heart's content and report found bugs First! Ditto!

Re: [fpc-pascal] alloca

2022-05-14 Thread Marco van de Voort via fpc-pascal
On 14-5-2022 17:51, Jonas Maebe via fpc-pascal wrote: On 14/05/2022 17:31, Marco van de Voort via fpc-pascal wrote: Also when an exception happens, the stack pointer is not as expected in exception frames (don't know if that really is an issue, but I can image).  It would be interesting how C

Re: [fpc-pascal] alloca

2022-05-14 Thread Marco van de Voort via fpc-pascal
On 14-5-2022 10:49, Hairy Pixels via fpc-pascal wrote: Apparently what it does is advance the stack pointer x bytes and return a pointer to the new location so you could probably do that with some assembly. Of course this is dangerous because you can request more memory than exists in the

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-25 Thread Marco van de Voort via fpc-pascal
On 25-4-2022 11:11, Sven Barth via fpc-pascal wrote: Then you don't think creative enough. Think about (de)serialization code for binary data which needs to use the correct size. If done correctly this can very well be handled with a generic. Actually that's what I immediate thought of too,

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-24 Thread Marco van de Voort via fpc-pascal
Op 24/04/2022 om 04:37 schreef Hairy Pixels via fpc-pascal: On Apr 23, 2022, at 10:30 PM, Marco van de Voort via fpc-pascal wrote: Btw since you are afaik an Apple user, did you actually use conformant arrays, or do you base this on UCSD/Borland dialects only? I started with THINK Pascal

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-23 Thread Marco van de Voort via fpc-pascal
On 23-4-2022 16:09, Hairy Pixels via fpc-pascal wrote: For 2) I'm also of the opinion of the others: this is unneeded syntactic sugar. There is already a way to declare arrays with a specific size and for a language it's in nearly all cases not good to provide multiple ways to achieve the

Re: [fpc-pascal] Just out of curiosity: Compiling FPC trunk and fpcmake

2022-03-22 Thread Marco van de Voort via fpc-pascal
On 21-3-2022 22:45, Karoly Balogh via fpc-pascal wrote: Hi, I can reproduce this, or something very similar for the clean/distclean targets, if I have no FPC installed on my machine, but I specify PP= as a Makefile argument to a "bootstrap" compiler binary, and I use OS_TARGET= as well, for

Re: [fpc-pascal] Just out of curiosity: Compiling FPC trunk and fpcmake

2022-03-21 Thread Marco van de Voort via fpc-pascal
On 21-3-2022 22:17, Victor Campillo via fpc-pascal wrote: make: -iVSPTPSOTO: Command not found Makefile:235: *** The Makefile doesn't support target -, please run fpcmake first.  Stop. Binary "fpc" not found. Maybe a different account or something else changed in your $PATH ?

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Marco van de Voort via fpc-pascal
On 16-1-2022 14:18, Ryan Joseph via fpc-pascal wrote: I had some fun today on my day off and managed to actually implement this based on the if-statement based string case labels. Is the compiler team interested in this feature? I think it's a clearly useful addition to OOP and an

Re: [fpc-pascal] Building fpc 3.2.2 from sources - which compiler to use for install?

2021-12-06 Thread Marco van de Voort via fpc-pascal
Op 6-12-2021 om 12:53 schreef Bo Berglund via fpc-pascal: I.e. should I use the newly compiled 3.2.2 in this step or the seed compiler, which is the previous version? New. See buildfaq. ___ fpc-pascal maillist -

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Marco van de Voort via fpc-pascal
Op 10-9-2021 om 09:46 schreef Sven Barth via fpc-pascal: You can use the ipconfig command and parse its output (especially ipconfig /all). Afaik netsh has more info. I have several tests  for this in Delphi, but they use the iphlp headers that FPC doesn't have yet (a point on my todo list).

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-12 Thread Marco van de Voort via fpc-pascal
Op 2021-08-12 om 08:12 schreef Christo Crause via fpc-pascal: This example downloads about 46 MiB of data, which expands to around 309 MiB on disk, of which 50 MiB is git information.  Note that a full clone is about 500MB. Still, it is a nice to have for e.g. machines that only do release

Re: [fpc-pascal] TProcess read buffer size

2021-07-15 Thread Marco van de Voort via fpc-pascal
Op 2021-07-15 om 20:26 schreef Ryan Joseph via fpc-pascal: I have some code the basically does: while bytesRead > 0 do bytesRead := process.Output.Read(buffer^, kBufferSize); but bytesRead is only ever 512 per call to Read. Is this a system imposed limit or something that's part of

Re: [fpc-pascal] https://sourceforge.net/projects/freepascal/files/Source/3.2.2/ : Missing install.sh

2021-07-07 Thread Marco van de Voort via fpc-pascal
Op 2021-07-06 om 22:37 schreef Jean Pierre CASSOU via fpc-pascal: https://sourceforge.net/projects/freepascal/files/Source/3.2.2/ Missing install.sh Install is a script to install _binary_ releases, and is part of the

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-17 Thread Marco van de Voort via fpc-pascal
Op 2021-06-16 om 23:49 schreef Jean SUZINEAU via fpc-pascal: My best score is 67 kb after strip -s with the code below ... ;-) The fact that you use "result" for function result indicates that you use a object pascal mode,  and not the default. If you don't do that (compile in the default

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
Op 2021-06-16 om 12:30 schreef Mattias Gaertner via fpc-pascal: Since the final binary size after using strip -s on the exe file is 271 kb it seems a bit big! Or is there a lot behind the scenes I have missed? Classes is a hog. I had a look, and only tthreadlist (and with that tlist) were

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
Op 2021-06-16 om 11:21 schreef Tomas Hajny via fpc-pascal:  Or if they contain $R inclusions. ...or many other things which may not be smartlinked, either because it is not possible, or because the compiler and/or linker cannot do it right now. Yes. But it is good to keep the things that

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
Op 2021-06-16 om 09:16 schreef Mattias Gaertner via fpc-pascal: On Wed, 16 Jun 2021 08:57:13 +0200 Bo Berglund via fpc-pascal wrote: If I by habit add a bunch of often used units to the uses clause will that affects the size of the compiled application even if they are not in fact used?

Re: [fpc-pascal] -FNsystem

2021-05-27 Thread Marco van de Voort via fpc-pascal
Op 2021-05-27 om 13:31 schreef Mattias Gaertner via fpc-pascal: There are some dotted units in fpc, e.g. system.uitypes. So it would be nice to have -FNsystem in the default fpc.cfg (Delphi compatible). What do you think? In principle yes, but keep in mind that then probably first uitypes

[fpc-pascal] FPC 3.2.2 released

2021-05-21 Thread Marco van de Voort via fpc-pascal
Hello, Finally, the Free Pascal 3.2.2 release is available from our servers and from sourceforge. Changes that may break backwards compatibility will be documented at: http://wiki.freepascal.org/User_Changes_3.2.2 For an overview of what is new see the summary below The website has been

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-19 Thread Marco van de Voort via fpc-pascal
Op 2021-05-18 om 23:29 schreef Travis Siegel via fpc-pascal: I'm not positive, but I'm pretty sure the sleep command in linux does not behave the same way it does in windows. As you know, in windows, a sleep command (even if delivered with a parameter of 0) gives up time slices to other

Re: [fpc-pascal] 50 years of Pascal, by the the author himself

2021-05-13 Thread Marco van de Voort via fpc-pascal
Op 2021-05-13 om 01:51 schreef Brian via fpc-pascal: There are still some OpenVMS sites out there, which would lead you to assume that VAX Pascal is still alive and kicking, albeit very much a minority compiler. For historic pascal compilers, have a look at this list:

Re: [fpc-pascal] Separate release cycle for RTL and compiler proposal

2021-04-19 Thread Marco van de Voort via fpc-pascal
Op 2021-04-19 om 07:52 schreef Karoly Balogh via fpc-pascal: No, the RTL and the compiler are tightly coupled. What might be possible are further packages like the FCL and interfaceing units, but the core RTL itself definitely not. I think the need comes from the fact that the release cycle

Re: [fpc-pascal] Version 3.2.2 changes

2021-04-11 Thread Marco van de Voort via fpc-pascal
Op 2021-04-11 om 15:21 schreef Marco van de Voort via fpc-pascal: Op 2021-04-09 om 10:42 schreef Florian Klämpfl via fpc-pascal:  but the "fix version" of most bug reports does not get updated when fixes are backported. I used to spend days on going through all merges and updating

Re: [fpc-pascal] Version 3.2.2 changes

2021-04-11 Thread Marco van de Voort via fpc-pascal
Op 2021-04-09 om 10:42 schreef Florian Klämpfl via fpc-pascal:  but the "fix version" of most bug reports does not get updated when fixes are backported. I used to spend days on going through all merges and updating the merge revisions and fix versions when a release was nearing, but I no

Re: [fpc-pascal] Minimal size of compiled library (DLL under Windows)

2021-04-03 Thread Marco van de Voort via fpc-pascal
Op 2021-04-03 om 13:22 schreef LacaK via fpc-pascal: I am guessing, that there must be something in initialization sections of units (SysUtils and Classes), which cause that some code is included, right? Can I somehow to avoid this grow of size (for example I need from Classes only

Re: [fpc-pascal] Hide warning number

2021-03-25 Thread Marco van de Voort via fpc-pascal
Op 2021-03-25 om 16:28 schreef Ryan Joseph via fpc-pascal: Is there a way to hide a warning for all files from the command line? The "not inlined" warnings (6058) are too numerous to even be useful anymore so I'd like to disable it. from FPC -h:  -v  Be verbose. is a combination of the

Re: [fpc-pascal] Pass type as function parameter

2021-03-24 Thread Marco van de Voort via fpc-pascal
Op 2021-03-24 om 11:05 schreef Michael Van Canneyt via fpc-pascal: Would it be possible in FPC to pass a type of a variable as a parameter to a function? e.g.  MyFunction(integer); I have legacy C code that does this via a macro. Hopefully, it can be done so I do not need to change the

Re: [fpc-pascal] Unicode chars losing information

2021-03-07 Thread Marco van de Voort via fpc-pascal
Op 2021-03-07 om 22:26 schreef Bart via fpc-pascal: On Sun, Mar 7, 2021 at 5:31 PM Marco van de Voort via fpc-pascal wrote: Probably it is not in the BMP and thus needs more position than one. Length(Char) is 5 according to fpc, I see 5 "graphemes" Indeed: .Ld1$strlab:

Re: [fpc-pascal] Unicode chars losing information

2021-03-07 Thread Marco van de Voort via fpc-pascal
Op 2021-03-07 om 17:38 schreef Ryan Joseph via fpc-pascal: On Mar 7, 2021, at 9:31 AM, Marco van de Voort via fpc-pascal wrote: Probably it is not in the BMP and thus needs more position than one. Isn't char[1] a 2 byte wide char? Not sure I understand "more position than on&quo

Re: [fpc-pascal] Unicode chars losing information

2021-03-07 Thread Marco van de Voort via fpc-pascal
Op 2021-03-07 om 17:21 schreef Ryan Joseph via fpc-pascal: I came across a bug which was caused but a unicode character losing information and narrowed it down to this. Why doesn't the chars[1] print the same character as appeared in the string? var chars: UnicodeString; begin chars :=

Re: [fpc-pascal] Strange output from make when building 3.2.0

2021-02-25 Thread Marco van de Voort via fpc-pascal
Op 2021-02-25 om 10:12 schreef Bo Berglund via fpc-pascal: I am installing fpc 3.2.0 on a notebook running Ubuntu 20.04 LTS When I execute make clean and make sourceinstall I get this strange output message: :~/dev/fpc/3.2.0$ time make sourceinstall PREFIX=$HOME make: -iVSPTPSOTO: Command

Re: [fpc-pascal] Traits Proposal

2021-02-19 Thread Marco van de Voort via fpc-pascal
Op 2021-02-19 om 16:50 schr So the method resolution doesn't actually change the VMT table of the class, just the interface? See it like this: An interface is a fragment of VMT. All methods of the interface are there in order. If implemented right, it is like a pointer into the

Re: [fpc-pascal] Traits Proposal

2021-02-17 Thread Marco van de Voort via fpc-pascal
Op 2021-02-17 om 00:02 schreef Benito van der Zander via fpc-pascal: And there often is a lot of unintentional deep copying. This is also why a property returning a record is fairly useless except for extremely small records like TPoint (and even that is not optimal no But a managed

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Marco van de Voort via fpc-pascal
Op 2021-02-16 om 21:33 schreef Ryan Joseph via fpc-pascal: On Feb 16, 2021, at 1:27 PM, Marco van de Voort via fpc-pascal wrote: And there often is a lot of unintentional deep copying. This is also why a property returning a record is fairly useless except for extremely small records

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Marco van de Voort via fpc-pascal
Op 2021-02-16 om 19:21 schreef Ryan Joseph via fpc-pascal: Interfaces are extremely slow. Virtual method calls are also slow. I have been using interfaces for reference counting, and have been thinking to replace it all with managed records because they are so slow (unfortunately records can

Re: [fpc-pascal] Traits Proposal

2021-02-15 Thread Marco van de Voort via fpc-pascal
Op 2021-02-15 om 18:08 schreef Ryan Joseph via fpc-pascal: As I understand, this is not a method hiding, but just to tell the compiler which method to implement the interface—the interface could have method names which are very very common to use and this syntax allows us to "rename" those

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Marco van de Voort via fpc-pascal
Op 2021-02-14 om 17:16 schreef Michael Van Canneyt via fpc-pascal: except it doesn't require an interface. The thing we seem to want here is a default property which works on records/objects so maybe we can just focus on that? The interface has so much boiler plate and I don't really see

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Marco van de Voort via fpc-pascal
Op 2021-02-14 om 13:30 schreef Michael Van Canneyt via fpc-pascal: I think the "performance implications" is more referring to memory management. Interfaces means an extra object per interface, so more objects on the heap with all the extra memory management that implies. (not interfaces

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-13 Thread Marco van de Voort via fpc-pascal
Op 2021-02-12 om 22:48 schreef James Richters via fpc-pascal: The problem I have had is when programs I compile generate a false virus detection.. sure on my own computer I can just disable that directory from the virus scanner but it becomes a problem when I release it to my customers and

Re: [fpc-pascal] Question about System.Move()

2021-01-12 Thread Marco van de Voort via fpc-pascal
Op 2021-01-11 om 15:26 schreef Benito van der Zander via fpc-pascal: Hi, perhaps a  safe, generic function for this copying could be added to the RTL. Like: Procedure ManagedMove(const source: T;var dest: T;count: SizeInt); a) For non-managed types it would be the same as Move(source,

Re: [fpc-pascal] Question about System.Move()

2021-01-09 Thread Marco van de Voort via fpc-pascal
Op 2021-01-09 om 20:12 schreef Yuriy Sydorov via fpc-pascal:  So, if I move Arr[3] to Arr[1], I first have to finilize/free Arr[1]. After that move the bytes in Arr[3] are exactly the same as in Arr[1] (by definition of how move works) AFAIU. Is that a problem with refcounts, because they

Re: [fpc-pascal] FPDoc now with Markdown support

2021-01-02 Thread Marco van de Voort via fpc-pascal
Op 2021-01-02 om 15:31 schreef Michael Van Canneyt via fpc-pascal: Hello ! I didn't make it quite in time for the new year, but still: The fpdoc engine (what is used to document the FPC & Lazarus units) is now capable of outputting the documentation in markdown. After this update I get

Re: [fpc-pascal] Two versions of freemem() - are they equal

2020-12-30 Thread Marco van de Voort via fpc-pascal
Op 2020-12-30 om 23:54 schreef Graeme Geldenhuys via fpc-pascal: Do both these method yield the same result, or is one better (performance, safer?) that the other? procedure FreeMem(p:pointer;Size:ptruint); procedure FreeMem(p:pointer); They are the same.   TP required size for deallocation,

Re: [fpc-pascal] Reading Serial Hex Data

2020-12-28 Thread Marco van de Voort via fpc-pascal
Op 12/27/2020 om 4:47 PM schreef James Richters via fpc-pascal: I'm trying to figure out how to read a packet of HEX Bytes of an unknown length that have no specific termination character over a serial port as efficiently as practical. The packet ends when there is just no more data to read. I

Re: [fpc-pascal] TurboVision is reborn as FOSS (again)

2020-12-22 Thread Marco van de Voort via fpc-pascal
Op 2020-12-22 om 00:42 schreef gabor via fpc-pascal: W dniu 2020-12-21 o 23:41, Sven Barth via fpc-pascal pisze: > The main restriction is that it only supports ShortString and thus has > no Unicode support. I wonder which type would be best suited to store a unicode character (code point)

Re: [fpc-pascal] Compilation speed on Apple M1

2020-11-21 Thread Marco van de Voort via fpc-pascal
Op 2020-11-21 om 14:15 schreef Florian Klämpfl via fpc-pascal: Am 21.11.2020 um 12:54 schrieb Tobias Giesen via fpc-pascal: According to Geekbench, the single core performance on the new Mac is around 1.8x as fast as my Intel Mac. Multicore is also much faster. I wonder why I don't see the

Re: [fpc-pascal] link.res search dirs when cross compiling

2020-11-18 Thread Marco van de Voort via fpc-pascal
Op 2020-11-18 om 19:21 schreef Benito van der Zander via fpc-pascal: where do the SEARCH_DIRs in link.res come from? Some are hardcoded, and fpc.cfg might contain -Fl lines with paths too from parsing ld.so.conf on install ___ fpc-pascal

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-06 Thread Marco van de Voort via fpc-pascal
Op 2020-10-05 om 20:45 schreef Ryan Joseph via fpc-pascal: I often need to use a function which reads a file into a string, as is so common in so many scripting languages. Can it be considered to add something like this to the RTL? Since we have a refcounted Ansistring type it's natural for

Re: [fpc-pascal] Merging units

2020-10-02 Thread Marco van de Voort via fpc-pascal
Op 2020-10-02 om 19:55 schreef Ryan Joseph via fpc-pascal: Something that's bothered me for a while I wanted to ask about. I have a package I want to distribute which has 2 or more units, all of which are required to use the package. Technically all the code should be in one file but because

Re: [fpc-pascal] -Fu unit search path and network paths

2020-09-21 Thread Marco van de Voort via fpc-pascal
Op 2020-09-21 om 13:44 schreef LacaK via fpc-pascal: are supported in -Fu (unit search path) networks paths? i.e. -Fu\\server\share -Fu\\server\share\path ? Correction: unit cannot be found only if it is placed in "share root" \\server\share ! When is placed in \\server\share\path then it

Re: [fpc-pascal] -Fu unit search path and network paths

2020-09-21 Thread Marco van de Voort via fpc-pascal
Op 2020-09-21 om 08:57 schreef LacaK via fpc-pascal: Hi *, are supported in -Fu (unit search path) networks paths? i.e. -Fu\\server\share -Fu\\server\share\path ? Correction: unit cannot be found only if it is placed in "share root" \\server\share ! When is placed in \\server\share\path

Re: [fpc-pascal] x86-linux-gnu cross

2020-09-01 Thread Marco van de Voort via fpc-pascal
Op 2020-09-01 om 20:28 schreef Adriaan van Os via fpc-pascal: On Mac OS X 10.8, I have built an fpc-3.0.4  runtime-library for CPU_TARGET=x86_64 OS_TARGET=linux BINUTILSPREFIX=x86_64-linux-gnu- after building gnu binutils-2.34 for  --target=x86_64-linux-gnu --host=i686-apple-darwin

Re: [fpc-pascal] FPC coding standards

2020-08-18 Thread Marco van de Voort via fpc-pascal
Op 2020-08-18 om 23:01 schreef Sven Barth via fpc-pascal: I see what I can do with ptop config and if need be see what it will take to improve ptop. Or investigate starting over with pparser, pastree, paswrite, as I'm already looking at those for some other things.