Sign in Join

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

Mailing lists / lazarus / 2016-01

Lazarus trunc does not compile with fpc 2.6.4 Win32

14 messages · 8 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner
to leledumbo
> Isn't it possible anymore to compile svn Lazarus with fc 2.6.4 ?? No. Latest stable is the only one that's supported, latest stable is 3.0.0.

FPC 3.0.0 is still fresh. We should try to give users some more time to port their software.

In this particular case RawByteString is not needed and not intended. It probably was created by auto completion of

xIconFiles|:=ChangeFileExt();

Code completion needs a heuristic when to use String (or maybe AnsiString) instead of RawByteString.

Mattias

Reply by email

Juha Manninen
to leledumbo: No. Latest stable is the only one that's supported, latest stable is 3.0.0. View this…
leledumbo wrote
> Isn't it possible anymore to compile svn Lazarus with fc 2.6.4 ?? No. Latest stable is the only one that's supported, latest stable is 3.0.0.

Actually we plan to keep Lazarus compilable with FPC 2.6.4 for some time. Typically it should support 2 last versions of FPC. It would mean that 2.6.4 is dropped when 3.0.2 comes out.
Now however the new UTF-8 system breaks existing code when it depends on system codepage on Windows. One way to solve the problem is to continue using FPC 2.6.4. Lazarus compilation for 2.6.4 can be maintained relatively easily. No need to break it anytime soon.

The problematic commit was r51233 by Ondrej. I planned to fix it but Mattias did already.

Juha

Reply by email

Ondrej Pokorny
to Mattias Gaertner: On Mon, 11 Jan 2016 07:00:59 -0700 (MST) FPC 3.0.0 is still fresh. We should try to give…
Mattias Gaertner wrote
In this particular case RawByteString is not needed and not intended. It probably was created by auto completion of xIconFiles|:=ChangeFileExt();

Correct. It wasn't definitely intended. I'll be more careful when using Code Completion.

Mattias Gaertner wrote
Code completion needs a heuristic when to use String (or maybe AnsiString) instead of RawByteString.

I think it fails to find exact overloads.

Ondrej

Reply by email

Mattias Gaertner
to Ondrej Pokorny
Show quoted text 7 lines
[...] > xIconFiles|:=ChangeFileExt(); [...] > Code completion needs a heuristic when to use String (or maybe > AnsiString) instead of RawByteString. I think it fails to find exact overloads.

There is no overload. There is only one definition:

{$define PathStr:=RawByteString}
function ChangeFileExt(const FileName, Extension: PathStr): PathStr;

Note to self: it would be nice if Find Declaration would jump to the macro definition of PathStr.

Mattias

Reply by email

Michael Van Canneyt
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote 10 lines
On Mon, Jan 11, 2016 at 10:32 AM, Mattias Gaertner < > wrote: > There is no overload. There is only one definition: > > {$define PathStr:=RawByteString} > why not type PathStr= RawByteString; ?
Poor mans generics, re-reading the same include file with different definition of
{$define PathStr:=RawByteString}

Michael.

Reply by email

John Landmessser
to Mattias Gaertner: On Mon, 11 Jan 2016 14:24:40 +0100 Fixed. Mattias
Mattias Gaertner wrote 15 lines
On Mon, 11 Jan 2016 14:24:40 +0100 "John Landmesser" wrote: > [...] > Kompiliere Package IDEIntf 1.0: Exit code 1, Fehler: 4, Hinweise: 1 > projectintf.pas(708,14) Error: Identifier not found "RawByteString" Fixed. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Mattias fixed and therefore i can compile Lazarus at home ( problem occured in office today )?!!

I'll see tomorrow.

Thanks in advanced :-))

John Landmesser

Reply by email

Ondrej Pokorny
to Mattias Gaertner: On Mon, 11 Jan 2016 16:13:49 +0100 There is no overload. There is only one definition:…
Mattias Gaertner wrote 9 lines
On Mon, 11 Jan 2016 16:13:49 +0100 Ondrej Pokorny wrote: > I think it fails to find exact overloads. There is no overload. There is only one definition: {$define PathStr:=RawByteString} function ChangeFileExt(const FileName, Extension: PathStr): PathStr;

finah.inc is loaded twice with different PathStr macro so there are effectively 2 overloaded ChangeFileExt.

The issue can be easily reproduced (try to complete X):

function StrFunc(Str: string): string;
begin
   Result := Str;
end;
function StrFunc(Str: RawByteString): RawByteString;
begin
   Result := Str;
end;
procedure Test;
var
   R: RawByteString;
   S: string;
begin
   X := StrFunc(S);
end;

This is because both string and RawByteString have the same default type (AnsiString) in CodeTools.

The same is for numbers (and any other type defined with "child = type parent"):

type
   PtrInt = type Longint;
function NumFunc(Num: PtrInt): PtrInt;
begin
   Result := Num;
end;
function NumFunc(Num: Integer): Integer;
begin
   Result := Num;
end;
procedure Test;
var
   I: Integer;
   P: PtrInt;
begin
   X := NumFunc(P);
end;

=> CodeTools fail to find the exact matching overload if there is another less good (but still acceptable) overload. CodeTools are fine when they found one compatible overload, not the best that is actually picked up by the compiler.

Are you aware of this bug (or are you aware of an issue report in mantis)?

Ondrej

Reply by email

Mattias Gaertner
to Ondrej Pokorny
[...] finah.inc is loaded twice with different PathStr macro so there are effectively 2 overloaded ChangeFileExt.

You are right.

Show quoted text 29 lines
The issue can be easily reproduced (try to complete X): function StrFunc(Str: string): string; begin Result := Str; end; function StrFunc(Str: RawByteString): RawByteString; begin Result := Str; end; procedure Test; var R: RawByteString; S: string; begin X := StrFunc(S); end; This is because both string and RawByteString have the same default type (AnsiString) in CodeTools. [...] => CodeTools fail to find the exact matching overload if there is another less good (but still acceptable) overload. CodeTools are fine when they found one compatible overload, not the best that is actually picked up by the compiler. Are you aware of this bug (or are you aware of an issue report in mantis)?

I'm aware. Codetools have only three states: exact, compatible and incompatible. But in case of RawByteString and UnicodeString one "compatible" is not enough.

Mattias

Reply by email

Ondrej Pokorny
to Mattias Gaertner
Mattias Gaertner wrote
I'm aware. Codetools have only three states: exact, compatible and incompatible. But in case of RawByteString and UnicodeString one "compatible" is not enough.

This is somehow not entirely correct (I haven't checked why). The integer example I gave in the last email also fails. That should comply with the "exact" state (PtrInt used both as variable and overload parameter).

Maybe the desired behavior (match for exact state) has a bug as well.

Ondrej

Reply by email