Re: [fpc-pascal] Floating point question

2024-02-22 Thread Peter B via fpc-pascal
On 22/02/2024 14:22, Jean SUZINEAU via fpc-pascal wrote: As far as I know Extended is not supported on Linux. This is wrong, sorry.  I'm using Extended on Linux and it works just fine. Cheers, Peter ___ fpc-pascal maillist -

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

2024-01-08 Thread Peter B via fpc-pascal
On 07/01/2024 16:07, James Richters via fpc-pascal wrote: Try building with smartlinking, -XX I never knew there was an option for smartlinking. I'm using the FPC text IDE, I see various options like Generate Smaller Code, and level 1, 2, and 3 optimizations, but I don't see anything

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

2024-01-07 Thread Peter B via fpc-pascal
Try building with smartlinking, -XX I get 35k Thats with 3.2.2 on linux ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2024-01-07 Thread Peter B via fpc-pascal
On 06/01/2024 19:05, Matthew Phillips via fpc-pascal wrote: I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer languages, like Golang, that's not bad at all. I then compiled the equivalent C program with gcc which came out at 33k. So I'm just

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread Peter B via fpc-pascal
On 19/12/2023 11:36, James Richters via fpc-pascal wrote: I did notice that I cannot have a file of Ansistrings… Myfile : File of Ansistring; Causes a compiler error: Error: Typed files cannot contain reference-counted types. I would just define the file as 'Text'. Can then Readln into an

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

2023-09-01 Thread Peter B via fpc-pascal
Can you compile the crashing program with  -gl    ? That should give you a useful stack dump with line numbers. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Peter B via fpc-pascal
On 16/06/2023 11:55, Giuliano Colla via fpc-pascal wrote: Is that the intended behavior of compiler? Yes. Assigning a 64bit integer to a 32bit one is fine as long as the range is within bounds. Range of a variable can only be checked at run time.

Re: [fpc-pascal] Passing around Pascal strings vs AnsiString

2023-06-15 Thread Peter B via fpc-pascal
On 14/06/2023 14:20, Hairy Pixels via fpc-pascal wrote: I was curious, if you had a Pascal (short) string and it was going to be passed around often would that be slower than using an AnsiString since its size is that of a pointer? I always prefer short strings when I know the length will be

Re: [fpc-pascal] Size of set.

2023-05-23 Thread Peter B via fpc-pascal
On 23/05/2023 01:14, Mikael Backman via fpc-pascal wrote: Hi, basic questions here. Is there any way to decide the number of elements in a set?  there any way to  traverse the elements in a set? Regards Mikael ___ fpc-pascal maillist -

Re: [fpc-pascal] pointer to char vs pchar

2023-03-24 Thread Peter B via fpc-pascal
On 24/03/2023 14:29, Martin Frb via fpc-pascal wrote: On 24/03/2023 15:04, Benito van der Zander via fpc-pascal wrote: why is a pointer to a char not a pchar (for type helpers)? My guess: For the same reason that "p2" fails in the below. Distinct type. May be assignment compatible, but a type

Re: [fpc-pascal] Lack of PIC code support for m68k CPU (was: FPC crashes with Internal error 200502052 compiling shared library on m68k)

2023-03-10 Thread Peter B via fpc-pascal
Thanks for your interest in this Charlie. Just requesting that maybe any more thoughts on this subject could go to the bug report? https://gitlab.com/freepascal.org/fpc/source/-/issues/40177 As this thread will probably be lost in the mists of time, but the bug report should stay open till

Re: [fpc-pascal] Lack of PIC code support for m68k CPU (was: FPC crashes with Internal error 200502052 compiling shared library on m68k)

2023-03-09 Thread Peter B via fpc-pascal
On 08/03/2023 21:34, Pierre Muller via fpc-pascal wrote: For m68k, (3104) Compiling StdAI.lpr (3104) Compiling Protocol.pas Protocol.pas(1963,36) Fatal: Internal error 200502052 Fatal: (1018) Compilation aborted Error: /usr/bin/ppc68k returned an error exitcode make[1]: *** [debian/rules:27:

[fpc-pascal] FPC crashes with Internal error 200502052 compiling shared library on m68k

2023-03-03 Thread Peter B via fpc-pascal
On Debian 12 (Bookworm) FPC release version 3.2.2 crashes on m68k when trying to build a shared library. See https://buildd.debian.org/status/package.php?p=doublecmd https://buildd.debian.org/status/package.php?p=c-evo-dh Scroll down to "Tail of log for ... m68k:" I have searched the bug

Re: [fpc-pascal] Get highest element of a StringList

2022-09-12 Thread Peter B via fpc-pascal
On 12/09/2022 07:52, Jean SUZINEAU via fpc-pascal wrote: As Bart suggested, you can use too the for/in loop:  for s in sl do WriteLn( s); And that is IMHO by far the most elegant, and least error prone, representation. Cheers, Peter ___ fpc-pascal

Re: [fpc-pascal] Access Violation When SetLength(DynArray, Value)

2022-09-08 Thread Peter B via fpc-pascal
I suggest trying without optimisations and/or using cmem, to see if that changes the outcome. Also, if the array is corrupted prior to the setlength, then iterating the array with a trivial   with... Writeln(Color) or whatever, should trigger an exception. That could then be used at various

Re: [fpc-pascal] Arguments gets corrupted with anonymous nested function

2022-09-07 Thread Peter B via fpc-pascal
I'm wondering if this is related to https://gitlab.com/freepascal.org/fpc/source/-/issues/38703 That caused a parameter corruption in a standard function. https://lists.freepascal.org/pipermail/fpc-pascal/2022-March/060361.html Should be easy to check. Just try compiling with -O1 Cheers,