* * *

Author Topic: Lazarus and FPC Trunk with Advanced Record  (Read 662 times)

BeanzMaster

  • Full Member
  • ***
  • Posts: 102
Lazarus and FPC Trunk with Advanced Record
« on: June 09, 2018, 07:47:19 pm »
Hi,

How i can i get Advanced Records work with latest Trunk versions  ?

Note i've installed with fpcupdeluxe

The complier raise :  Error: Record type expected

My code work fine with lazarus stable and fixes versions from 1.8.0 to 1.8.5 both under linux and windows

Thanks in advance

Bart

  • Hero Member
  • *****
  • Posts: 2980
    • Bart en Mariska's Webstek
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #1 on: June 09, 2018, 08:19:57 pm »
Code: Pascal  [Select]
  1. {$modeswitch advancedrecords}

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 6126
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #2 on: June 09, 2018, 09:44:01 pm »
{$mode delphi} is enough.
But Bart's suggestion will also work, except when you compile code that was written in Delphi.
« Last Edit: June 09, 2018, 09:47:21 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

BeanzMaster

  • Full Member
  • ***
  • Posts: 102
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #3 on: June 10, 2018, 11:55:31 am »
Code: Pascal  [Select]
  1. {$modeswitch advancedrecords}

Bart
But Bart's suggestion will also work, except when you compile code that was written in Delphi.

This Dont' Work with trunk versions
{$mode objfpc}{$H+}
{$modeswitch advancedrecords}
{$modeswitch typehelpers}

With all stable and fixes version it work very well

{$mode delphi} is enough.

With {$mode Delphi} it's work. Don't understand why.

Now i have an another error in my assembly code  :o

Code: Pascal  [Select]
  1. vectormath_vector2d_win64_sse_imp.inc(30,3) Error: Asm: [cvtdq2pd reg??,mem128] invalid combination of opcode and operands

Hum, damn !!!!

Thanks in advance

Thaddy

  • Hero Member
  • *****
  • Posts: 6126
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #4 on: June 10, 2018, 12:46:25 pm »
It seems like the parser for ObjFpc is broken in trunk. I have already reported an issue that may well be related.(But doesn't look like it! at first sight).
In that case Delphi mode works and ObjFpc mode fails. Plz report on the bug tracker with a compilable example.

Mantis 0033839/0033829
« Last Edit: June 10, 2018, 12:50:16 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

Bart

  • Hero Member
  • *****
  • Posts: 2980
    • Bart en Mariska's Webstek
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #5 on: June 10, 2018, 12:48:10 pm »
This Dont' Work with trunk versions
{$mode objfpc}{$H+}
{$modeswitch advancedrecords}
{$modeswitch typehelpers}

Works fine for me with fpc 3.0.4 and trunk (r39162).
Code: Pascal  [Select]
  1. program test;
  2. {$mode objfpc}{$H+}
  3. {$modeswitch advancedrecords}
  4. {$modeswitch typehelpers}
  5. type
  6.   TAR = record
  7.     procedure foo;
  8.   end;
  9.  
  10.   TTH = type helper for TAR
  11.     procedure bar;
  12.   end;
  13.  
  14. procedure TAR.Foo;
  15. begin end;
  16. procedure TTH.bar;
  17. begin end;
  18. begin
  19. end.

With {$mode Delphi} it's work. Don't understand why.

Mode Delphi activates modeswith advancedrecords.

Bart
« Last Edit: June 10, 2018, 12:53:25 pm by Bart »

Thaddy

  • Hero Member
  • *****
  • Posts: 6126
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #6 on: June 10, 2018, 12:51:55 pm »
39172 and higher breaks, Bart.
There is a regression in the objfpc parser.
« Last Edit: June 10, 2018, 12:53:43 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

Bart

  • Hero Member
  • *****
  • Posts: 2980
    • Bart en Mariska's Webstek
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #7 on: June 10, 2018, 12:54:16 pm »
39172 and higher breaks, Bart.
There is a regression.

I stand corrected then.
(And I won't update until that's fixed)

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 6126
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #8 on: June 10, 2018, 01:02:03 pm »
At least the compiler devs can possibly narrow it down to above r39162. Thanks Bart.
If you are not updating, can you try my code in the bug report?
That would confirm or deny the regression.
Mantis 0033839 or attachment in 0033829
« Last Edit: June 10, 2018, 01:05:59 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

BeanzMaster

  • Full Member
  • ***
  • Posts: 102
Re: Lazarus and FPC Trunk with Advanced Record
« Reply #9 on: June 11, 2018, 03:44:18 pm »
It seems like the parser for ObjFpc is broken in trunk. I have already reported an issue that may well be related.(But doesn't look like it! at first sight).
In that case Delphi mode works and ObjFpc mode fails. Plz report on the bug tracker with a compilable example.

Mantis 0033839/0033829

Hi, i can't  logging to the bucktraker, it says are an invalid member ???? (i tried like the information say with my email as userid)


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus