[Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

John Landmesser-3
i get this error message if i try to compile 
 
Lazarus 1.7 r50846 FPC 2.6.4 i386-win32-win32/win64
( last working version, December 2015 )
 
Message:
Kompiliere Package SynEdit 1.0: Abgebrochen, Warnungen: 1, Hinweise: 2
synedithighlighterfoldbase.pas(1168,43) Hint: Mixing signed expressions and longwords gives a 64bit result
syntextdrawer.pp(962,31) Warning: Symbol "CanUTF8" is deprecated
syneditfoldedview.pp(352,24) Hint: Value parameter "aFoldProvider" is assigned but never used
Kompiliere Package IDEIntf 1.0: Exit code 1, Fehler: 4, Hinweise: 1
projectintf.pas(708,14) Error: Identifier not found "RawByteString"
projectintf.pas(708,27) Error: Error in type definition
projectintf.pas(729,26) Error: Incompatible type for arg no. 1: Got "<erroneous type>", expected "AnsiString"
projectintf.pas(733,35) Error: Incompatible type for arg no. 1: Got "<erroneous type>", expected "AnsiString"
graphic.inc(236,20) Hint: Found declaration: TGraphic.LoadFromFile(const AnsiString);
 
My system:
 
Win32 , XP SP 2 
 
Isn't it possible anymore  to compile svn Lazarus with fc 2.6.4 ??
 

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

leledumbo
Administrator
> 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.
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Mattias Gaertner
On Mon, 11 Jan 2016 07:00:59 -0700 (MST)
leledumbo <[hidden email]> 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.

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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Mattias Gaertner
In reply to this post by John Landmesser-3
On Mon, 11 Jan 2016 14:24:40 +0100
"John Landmesser" <[hidden email]> 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
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Juha Manninen
In reply to this post by leledumbo
On Mon, Jan 11, 2016 at 4:00 PM, leledumbo <[hidden email]> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Ondrej Pokorny
In reply to this post by Mattias Gaertner
On 11.01.2016 15:22, 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.


On 11.01.2016 15:22, 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Mattias Gaertner
On Mon, 11 Jan 2016 16:13:49 +0100
Ondrej Pokorny <[hidden email]> wrote:

>[...]
> > 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

dmitry boyarintsev
On Mon, Jan 11, 2016 at 10:32 AM, Mattias Gaertner <[hidden email]> wrote:
There is no overload. There is only one definition:

{$define PathStr:=RawByteString}
why not
type
  PathStr= RawByteString; ?

thanks,
Dmitry

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Michael Van Canneyt


On Mon, 11 Jan 2016, Dmitry Boyarintsev wrote:

> On Mon, Jan 11, 2016 at 10:32 AM, Mattias Gaertner <
> [hidden email]> 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.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Mattias Gaertner
In reply to this post by dmitry boyarintsev
On Mon, 11 Jan 2016 10:46:00 -0500
Dmitry Boyarintsev <[hidden email]> wrote:

> On Mon, Jan 11, 2016 at 10:32 AM, Mattias Gaertner <
> [hidden email]> wrote:
>
> > There is no overload. There is only one definition:
> >
> > {$define PathStr:=RawByteString}
> >
> why not
> type
>   PathStr= RawByteString; ?

Good question. Maybe ask on the FPC list.

Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

John Landmesser-3
In reply to this post by Mattias Gaertner
Am 11.01.2016 um 15:23 schrieb Mattias Gaertner:

> On Mon, 11 Jan 2016 14:24:40 +0100
> "John Landmesser" <[hidden email]> 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
> [hidden email]
> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Ondrej Pokorny
In reply to this post by Mattias Gaertner
On 11.01.2016 16:32, Mattias Gaertner wrote:
> On Mon, 11 Jan 2016 16:13:49 +0100
> Ondrej Pokorny<[hidden email]>  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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Mattias Gaertner
On Mon, 11 Jan 2016 17:42:23 +0100
Ondrej Pokorny <[hidden email]> wrote:

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

You are right.

 

> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus trunc does not compile with fpc 2.6.4 Win32

Ondrej Pokorny
On 11.01.2016 18:18, 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus