[fpc-pascal] WideStringToUCS4String optimization

2019-10-11 Thread Alexey Tor.

Hi

{$ifdef FPC_HAS_FEATURE_DYNARRAYS}
procedure UCS4Encode(p: PWideChar; len: sizeint; out res: UCS4String);
  var
    i, reslen: sizeint;
    w: longint;
  begin
    reslen:=0;
    i:=0;
    { calculate required length }

this func loops over the buffer 2 times. 1) find len in UCS4 chars, 2) 
make UCS4 contents. Maybe make one loop only? Ie- a) SetLength for 
result to the len of source. b) single loop: copy content and also 
calculate real len. c) adjust (decrease) result len, if surrogate pairs 
were found (N pairs -> decrease by N)


--
Regards,
Alexey

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC 3.3 trunk error with CudaText

2019-10-11 Thread AlexeyT

Win10 x32, Free Pascal Compiler version 3.3.1-r43163 [2019/10/11] for i386
After installing FPC trunk (via fpcupdeluxe), I cannot run CudaText from 
IDE.

Also dont run from console:
The application has failed to start because its side-by-side 
configuration is incorrect. Please see the application event log or use 
the command-line sxstrace.exe tool for more detail.


Event Viewer:
Activation context generation failed for 
"C:\cuda\cudatext\app\cudatext.exe".Error in manifest or policy file 
"C:\cuda\cudatext\app\cudatext.exe" on line 0. Invalid Xml syntax.


At the end of .exe file i still see valid XML manifest, like before.
And CudaText from latest release runs ok, so its only compiled exe is bad.

(BTW, with this FPC, i could not make Lazarus, error on linking: No more 
memory. Solved it by removing 6 ide packages.)


--
Regards,
Alexey

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Bernd Mueller

On 10/11/19 10:51 AM, Bart wrote:


See 
https://www.freepascal.org/docs-html/current/prog/progsu69.html#x76-750001.2.69


sorry, I forgot to mention, that I checked with {$SAFEFPUEXCEPTIONS ON},
but it did not change the behavior.

Regards, Bernd.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Zamrony P. Juhara via fpc-pascal
I use FPC 3.0.4 on Ubuntu 16.04
I get same behavior after compile it with ppc386. 64bit binary executable run OK

Zamrony P. Juhara
Fano Framework, Free Pascal web application framework 
https://fanoframework.github.io
On Friday, October 11, 2019, 4:39:38 PM GMT+8, Bernd Mueller 
 wrote:  
 
 Hello,

FPC 3.0.4, Linux i386

the following program should catch the floating point exception
(always), but crashes on the fourth call to the procedure Run:

program test;
{$mode objfpc}{$H+}

procedure Run;
var
    r: Real;
    i: Integer;
begin
    i:= 1;
    try
      r:= i / 0.0;
    except
      r:= 0; // Crash  here on fourth call.
    end;
    Writeln('ok');
end;

begin
    Run;
    Run;
    Run;
    Run;
end.

The output:
ok
ok
ok
Runtime error 207 at $080480F9
  $080480F9
  $0804815C
  $0806644D

The program was compiled with no additional compiler parameters.
I could not reproduce this problem with the trunk version of the
compiler, but all versions down to 2.2.2 show the described behavior.
FPC 2.2.0 is working correct. The 64-bit version of FPC 3.0.4 works
correct too.

Is this something for the bug tracker?

Regards, Bernd.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
  ___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Bart
On Fri, Oct 11, 2019 at 10:39 AM Bernd Mueller  wrote:

> FPC 3.0.4, Linux i386
>
> the following program should catch the floating point exception
> (always), but crashes on the fourth call to the procedure Run:

See 
https://www.freepascal.org/docs-html/current/prog/progsu69.html#x76-750001.2.69

-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Bernd Mueller

Hello,

FPC 3.0.4, Linux i386

the following program should catch the floating point exception
(always), but crashes on the fourth call to the procedure Run:

program test;
{$mode objfpc}{$H+}

procedure Run;
var
   r: Real;
   i: Integer;
begin
   i:= 1;
   try
  r:= i / 0.0;
   except
  r:= 0; // Crash  here on fourth call.
   end;
   Writeln('ok');
end;

begin
   Run;
   Run;
   Run;
   Run;
end.

The output:
ok
ok
ok
Runtime error 207 at $080480F9
  $080480F9
  $0804815C
  $0806644D

The program was compiled with no additional compiler parameters.
I could not reproduce this problem with the trunk version of the
compiler, but all versions down to 2.2.2 show the described behavior.
FPC 2.2.0 is working correct. The 64-bit version of FPC 3.0.4 works
correct too.

Is this something for the bug tracker?

Regards, Bernd.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal