Sign in Join

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

Mailing lists / fpc-devel / 2008-03

compiler syntax bug : "Fatal: Syntax error, ")" expected but "(" found"

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

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

Inoussa OUEDRAOGO

Hi

I 'm about to file a bug report and would like to have a confirmation. The compiler conplains( see the code below ) :
"Fatal: Syntax error, ")" expected but "(" found"
It compiles under Delphi ( D7 ). I tried with "mode delphi" and "mode objfpc" and still got the
same syntax error ( WinXP fpc 2.2.1 19/11/2007 ).

Please can you confirm this bug.

Thanks.

<code>
program test_syntax;
{$IFNDEF FPC}
  {$APPTYPE CONSOLE}
{$ENDIF}
{$IFDEF FPC}
  {$mode objfpc}{$H+}
{$ENDIF}
type
{$IFNDEF FPC}
  PPtrInt = ^Integer;
{$ENDIF}
  PRecA = ^TRecA;
  TRecA = record
    _data : array[0..0] of Byte;
  end;
  TTestObj = class
    function Append() : PRecA;
  end;
function TTestObj.Append() : PRecA;
begin
  Result := nil;
end;
var
  ox : TTestObj;
begin
  ox := TTestObj.Create();
  PPtrInt(@((ox.Append()^._data[0])))^ := 0; //this one compiles
  PPtrInt(@(ox.Append()^._data[0]))^ := 0;   // error on this line :
"Fatal: Syntax error, ")" expected but "(" found"
end.

</code>

Inoussa O.

Reply by email

Inoussa OUEDRAOGO
to Inoussa OUEDRAOGO
Show quoted text 7 lines
I 'm about to file a bug report and would like to have a confirmation. The compiler conplains( see the code below ) : "Fatal: Syntax error, ")" expected but "(" found" It compiles under Delphi ( D7 ). I tried with "mode delphi" and "mode objfpc" and still got the same syntax error ( WinXP fpc 2.2.1 19/11/2007 ).

Test with the 2.3.1 r.10439 and the error is still there. Reported here http://bugs.freepascal.org/view.php?id=10933

Inoussa O.

Reply by email