Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-09

New linux compiler snapshot (1.0.5)

39 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Pavel V. Ozerski
to Free Pascal Compiler

Hello,
I tried to find causes of buggy behavior of the last 1.1 compiler if it tries to compile source with multidimensional dynamic arrays. The problem is not fully fixed but at least after my fix compiler does not reject SetLength with more than two parameters (but it works incorrectly then). My solution seems to be not a hack but a typical bugfix.

file: ninl.pas (created 06.Sep.01).
line 1540, old state:
(not(is_dynamic_array(left.resulttype.def))) then
line 1540, state after fix:
(not(is_dynamic_array(ppn.left.resulttype.def))) then

Sincerely, Pavel

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Pavel V. Ozerski
to Pavel V. Ozerski: I tried to find causes of buggy behavior of the last 1.1 compiler if it tries to compile…

Hello,

I found a important difference between FPC (1.1) and Delphi 3.0. This sample:

{$apptype console}
{$ifdef fpc}
{$mode delphi}
{$endif}
var
 x:integer;
begin
 readln(x);
 writeln(cardinal(x)>100);
end.

after accepting -1 returns "false" if it is compiled with Delphi but "true" if it is compiled with FreePascal.

I think, the behavior of FPC is more correct but then it is not Delphi-compatible here. But maybe it's a Delphi bug? Is this difference true also for Delphi 4,5,6?

Sincerely, Pavel

Reply by email

Peter Vreman
Show quoted text 18 lines
Hello, I found a important difference between FPC (1.1) and Delphi 3.0. This sample: {$apptype console} {$ifdef fpc} {$mode delphi} {$endif} var x:integer; begin readln(x); writeln(cardinal(x)>100); end. after accepting -1 returns "false" if it is compiled with Delphi but "true" if it is

compiled with FreePascal.

Kylix returns also true, so it's a bug in D3.

Reply by email

Barry Kelly
to Pavel V. Ozerski: I found a important difference between FPC (1.1) and Delphi 3.0. This sample: {$apptype…
Hello, I found a important difference between FPC (1.1) and Delphi 3.0.

[...]

Show quoted text 6 lines
var x:integer; begin readln(x); writeln(cardinal(x)>100);

D3's Cardinal is only 31 bits.

-- Barry

If you're not part of the solution, you're part of the precipitate. Team JEDI: http://www.delphi-jedi.org NNQ - Quoting Style in Newsgroup Postings http://web.infoave.net/~dcalhoun/nnq/nquote.html

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Pavel V. Ozerski
to Pavel V. Ozerski: I tried to find causes of buggy behavior of the last 1.1 compiler if it tries to compile…

Hello, I try to understand the way of working of setlength.

1)
A question: why tdynarraytypeinfo structure is so strange?

   tdynarraytypeinfo = packed record
      kind : byte;
      namelen : byte;
      { here the chars follow, we've to skip them }
      elesize : t_size;
      eletype : pdynarraytypeinfo;
   end;

If it is made so not for, e.g. Delphi compatibility, may be, that would be better, to reorder fileds in it to move variable-length part to end of structure. This change could avoid strange and dangerous pointer operations to get .elesize and .eletype values
Example:

   tdynarraytypeinfo = packed record
      kind : byte;
      elesize : t_size;
      eletype : pdynarraytypeinfo;
      case integer of
       0:(namelen:byte);
       1:(name:string[255]);
   end;

2) but what is a mean, to include type names into executable? I think, for most cases the information about element size is enough.

Sincerely, Pavel

Reply by email

Jonas Maebe
to Pavel V. Ozerski
Pavel V. Ozerski wrote
2) but what is a mean, to include type names into executable? I think, for most cases the information about element size is enough.

I do'nt know about you first question, but this is probably for run time type information or so...

Jonas

Reply by email

Unknown author
to Pavel V. Ozerski: Hello, I try to understand the way of working of setlength. 1) A question: why…
Pavel V. Ozerski wrote 16 lines
Hello, I try to understand the way of working of setlength. 1) A question: why tdynarraytypeinfo structure is so strange? tdynarraytypeinfo = packed record kind : byte; namelen : byte; { here the chars follow, we've to skip them } elesize : t_size; eletype : pdynarraytypeinfo; end; If it is made so not for, e.g. Delphi compatibility, may be, that would be better, to reorder fileds in it to move variable-length part to end of structure. This change could avoid strange and dangerous pointer operations to get .elesize and .eletype values

The type is declared like that exactly for Delphi compatibility; The RTTI information is stored like that.

Show quoted text 12 lines
Example: tdynarraytypeinfo = packed record kind : byte; elesize : t_size; eletype : pdynarraytypeinfo; case integer of 0:(namelen:byte); 1:(name:string[255]); end; 2) but what is a mean, to include type names into executable? I think, for most cases the information about element size is enough.

This is needed for Run-Time Type Information - for streaming.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Pavel V. Ozerski
to Pavel V. Ozerski: Hello, I try to understand the way of working of setlength. 1) A question: why…

Hello,
Today's compiler built from source (zip file 18.09.01) cannot find own exe path (and therefore .cfg file) correctly. Cause: at initialization of globals unit the proceure get_exepath is called. This procedure tries to fix dir separators in paramstr(0) and in found path to executable (using FixFileName and FixFilePath functions). These functions try to use source_info.dirsep but source_info structure is not initialized at this stage because initsystems procedure (unit systems) will be called only later! At result separators became #0.

A small related question:
What is the mean to try to fix paramstr(0) here? Its value contains dir separators got from OS, therefore they will be always correct!

sincerely, Pavel

Reply by email

Marco van de Voort
to Pavel V. Ozerski
A small related question: What is the mean to try to fix paramstr(0) here? Its value contains dir separators got from OS, therefore they will be always correct!

I think that it is because the GNU tools are often more pickier about mixing path separators. Therefore it is wise to streamline them early on.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Jonas Maebe
to Pavel V. Ozerski: I tried to find causes of buggy behavior of the last 1.1 compiler if it tries to compile…
Pavel V. Ozerski wrote 7 lines
I tried to find causes of buggy behavior of the last 1.1 compiler if it tries to compile source with multidimensional dynamic arrays. The problem is not fully fixed but at least after my fix compiler does not reject SetLength with more than two parameters (but it works incorrectly then). My solution seems to be not a hack but a typical bugfix.

You're correct, I've applied your fix. It seems however that before multiple dimensions are supported properly for dynamical arrays, a lot of things stil have to be changed in the compiler :( Currently, if you declare

var
   a: array of longint;

then a[<some index>] has always longint as return type. This means that a[1,1] won't be accepted, and high(a[1]) returns maxlongint. I don't really know how to fix this cleanly in the compiler, since in some cases you need "array of longint" as result type when using a[0], and in other cases you need "longint".

Jonas

Reply by email

Michael Van Canneyt
to Jonas Maebe
Jonas Maebe wrote 21 lines
On woensdag, september 12, 2001, at 10:00 , Pavel V. Ozerski wrote: > I tried to find causes of buggy behavior of the last 1.1 compiler if it > tries to compile source with > multidimensional dynamic arrays. The problem is not fully fixed but at > least after my fix compiler does not > reject SetLength with more than two parameters (but it works > incorrectly then). My solution seems to be not a hack > but a typical bugfix. You're correct, I've applied your fix. It seems however that before multiple dimensions are supported properly for dynamical arrays, a lot of things stil have to be changed in the compiler :( Currently, if you declare var a: array of longint; then a[<some index>] has always longint as return type.

It should have. What else should it have ?

If you want to declare a multidimensional array, you should declare it explicitly as

a : array of array of longint;

See the delphi manual (Multidimensional dynamic arrays)

a : array of longint

is always a one-dimensional array.

This means that a[1,1] won't be accepted, and high(a[1]) returns maxlongint.

This is correct and as it should be.

I don't really know how to fix this cleanly in the compiler, since in some cases you need "array of longint" as result type when using a[0], and in other cases you need "longint".
That is wrong;
Assuming the original declaration of a, a[1] is ALWAYS of type longint.

One issue is that, assuming the declaration

a : array of array of longint;

The following are valid calls to setlength:

Setlength(A,10,20) (10 arrays of each 20 longints) Setlength(A,10); (10 unallocated arrays of longint) Setlength(A[10],20) (set length of 10th array to 20)

Michael.

Reply by email

Jonas Maebe
to Michael Van Canneyt
Michael Van Canneyt wrote 12 lines
> var > a: array of longint; > > > then a[<some index>] has always longint as return type. It should have. What else should it have ? If you want to declare a multidimensional array, you should declare it explicitly as a : array of array of longint;

I was confused because we currently accept

var
   a: array of longint;
begin
   setlength(a,10,10);
end.
See the delphi manual (Multidimensional dynamic arrays)

I don't have delphi :)

a : array of longint is always a one-dimensional array.

That should make things slightly easier :)

Show quoted text 19 lines
> I don't > really know how to fix this cleanly in the compiler, since in some > cases > you need "array of longint" as result type when using a[0], and in > other > cases you need "longint". That is wrong; Assuming the original declaration of a, a[1] is ALWAYS of type longint. One issue is that, assuming the declaration a : array of array of longint; The following are valid calls to setlength: Setlength(A,10,20) (10 arrays of each 20 longints) Setlength(A,10); (10 unallocated arrays of longint) Setlength(A[10],20) (set length of 10th array to 20)

I haven't tested them all, but even the following program already terminates with an RTE 216 (and gives wrong output):

***
var a: array of array of longint;
begin
   setlength(a,10,5);
   writeln(high(a));
   writeln(high(a[1]));
end.
***

Jonas

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email

Free Pascal Compiler

Hello,

This is an automated message. A new linux snapshot has been compiled and has been installed on

ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/linux/

see
ftp://ftp.freepascal.org/pub/fpc/source/Changes.compiler ftp://ftp.freepascal.org/pub/fpc/source/Changes.rtl ftp://ftp.freepascal.org/pub/fpc/source/Changes.ide for more information.

Michael.

Reply by email